{"id":13749311,"url":"https://github.com/pkgcloud/pkgcloud","last_synced_at":"2025-04-09T03:11:23.700Z","repository":{"id":1967704,"uuid":"2898669","full_name":"pkgcloud/pkgcloud","owner":"pkgcloud","description":"pkgcloud is a standard library for node.js that abstracts away differences among multiple cloud providers.","archived":false,"fork":false,"pushed_at":"2024-05-16T09:24:13.000Z","size":13561,"stargazers_count":1177,"open_issues_count":211,"forks_count":372,"subscribers_count":71,"default_branch":"master","last_synced_at":"2024-10-29T15:48:17.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/pkgcloud/pkgcloud","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkgcloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-12-02T13:39:31.000Z","updated_at":"2024-10-07T07:59:37.000Z","dependencies_parsed_at":"2024-12-17T00:14:11.393Z","dependency_job_id":"8a2ada8d-3597-4ac8-a56c-c8b4a68703e7","html_url":"https://github.com/pkgcloud/pkgcloud","commit_stats":{"total_commits":1832,"total_committers":89,"mean_commits":"20.584269662921347","dds":0.8111353711790393,"last_synced_commit":"b6e5b0d4db8d164f444c780ac96c06e555e0b703"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkgcloud%2Fpkgcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkgcloud%2Fpkgcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkgcloud%2Fpkgcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkgcloud%2Fpkgcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkgcloud","download_url":"https://codeload.github.com/pkgcloud/pkgcloud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968370,"owners_count":21025823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T07:00:59.075Z","updated_at":"2025-04-09T03:11:23.682Z","avatar_url":"https://github.com/pkgcloud.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Multi-Cloud \u0026 Hybrid"],"sub_categories":["Cloud Abstraction"],"readme":"# pkgcloud [![Build Status](https://secure.travis-ci.org/pkgcloud/pkgcloud.png?branch=master)](http://travis-ci.org/pkgcloud/pkgcloud) [![NPM version](https://badge.fury.io/js/pkgcloud.png)](http://badge.fury.io/js/pkgcloud)\n\n[![Join the chat at https://gitter.im/pkgcloud/pkgcloud](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pkgcloud/pkgcloud?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\npkgcloud is a standard library for node.js that abstracts away differences among multiple cloud providers.\n\n* [Getting started](#getting-started)\n  * [Basic APIs](#basic-apis)\n  * [Unified Vocabulary](#unified-vocabulary)\n  * [Supported APIs](#supported-apis)\n* [Compute](#compute)\n* [Storage](#storage)\n  * [Uploading Files](#upload-a-file)\n  * [Downloading Files](#download-a-file)\n* [Database](#databases)\n* [DNS](#dns----beta) *(beta)*\n* [Block Storage](#block-storage----beta) *(beta)*\n* [Load Balancers](#load-balancers----beta) *(beta)*\n* [Orchestration](#orchestration----beta) *(beta)*\n* [Network](#network----beta) *(beta)*\n* [CDN](#cdn----beta) *(beta)*\n* _Fine Print_\n  * [Installation](#installation)\n  * [Tests](#tests)\n  * [Logging](#logging)\n  * [Code Coverage](#code-coverage)\n  * [Contribute!](#contributing)\n  * [Roadmap](#roadmap)\n\n\u003ca name=\"getting-started\"\u003e\u003c/a\u003e\n## Getting Started\n\nYou can install `pkgcloud` via `npm` or add to it to [dependencies](https://npmjs.org/doc/json.html#dependencies) in your `package.json` file:\n\n```\nnpm install pkgcloud\n```\n\nCurrently there are nine service types which are handled by pkgcloud:\n\n* [Compute](#compute)\n* [Storage](#storage)\n* [Database](#databases)\n* [DNS](#dns----beta) *(beta)*\n* [Block Storage](#block-storage----beta) *(beta)*\n* [Load Balancers](#load-balancers----beta) *(beta)*\n* [Network](#network----beta) *(beta)*\n* [Orchestration](#orchestration----beta) *(beta)*\n* [CDN](#cdn----beta) *(beta)*\n\nIn our [Roadmap](#roadmap), we plan to add support for more services, such as Queueing, Monitoring, and more. Additionally, we plan to implement more providers for the *beta* services, thus moving them out of *beta*.\n\n### User Agent\n\nBy default, all pkgcloud HTTP requests will have a user agent with the library and version: `nodejs-pkgcloud/x.y.z` where `x.y.z` is the current version.\n\nYou can get this from a client at any time by calling `client.getUserAgent();`. Some providers may have an additional suffix as a function of the underlying HTTP stacks.\n\nYou can also set a custom User Agent prefix:\n\n```javascript\nclient.setCustomUserAgent('my-app/1.2.3');\n\n// returns \"my-app/1.2.3 nodejs-pkgcloud/1.1.0\"\nclient.getUserAgent();\n```\n\n\u003ca name=\"basic-apis\"\u003e\u003c/a\u003e\n### Basic APIs for pkgcloud\n\nServices provided by `pkgcloud` are exposed in two ways:\n\n* **By service type:** For example, if you wanted to create an API client to communicate with a compute service you could simply:\n\n``` js\n  var client = require('pkgcloud').compute.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n* **By provider name:** For example, if you knew the name of the provider you wished to communicate with you could do so directly:\n\n``` js\n  var client = require('pkgcloud').providers.openstack.compute.createClient({\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\nAll API clients exposed by `pkgcloud` can be instantiated through `pkgcloud[serviceType].createClient({ ... })` or `pkcloud.providers[provider][serviceType].createClient({ ... })`.\n\n\u003ca name=\"unified-vocabulary\"\u003e\u003c/a\u003e\n### Unified Vocabulary\n\nDue to the differences between the vocabulary for each service provider, **[pkgcloud uses its own unified vocabulary](docs/vocabulary.md).**\n\n* **Compute:** [Server](#server), [Image](#image), [Flavor](#flavor)\n* **Storage:** [Container](#container), [File](#file)\n* **DNS:** [Zone](#zone), [Record](#record)\n\n**Note:** Unified vocabularies may not yet be defined for *beta* services.\n\n\u003ca name=\"supported-apis\"\u003e\u003c/a\u003e\n### Supported APIs\n\nSupporting every API for every cloud service provider in Node.js is a huge undertaking, but _that is the long-term goal of `pkgcloud`_. **Special attention has been made to ensure that each service type has enough providers for a critical mass of portability between providers** (i.e. Each service implemented has multiple providers).\n\nIf a service does not have at least two providers, it is considered a *beta* interface; We reserve the right to improve the API as multiple providers will allow generalization to be better determined.\n\n* **[Compute](#compute)**\n  * [Amazon](docs/providers/amazon.md#using-compute)\n  * [Azure](docs/providers/azure.md#using-compute)\n  * [DigitalOcean](docs/providers/digitalocean.md#using-compute)\n  * [HP](docs/providers/hp/compute.md)\n  * [Openstack](docs/providers/openstack/compute.md)\n  * [Rackspace](docs/providers/rackspace/compute.md)\n* **[Storage](#storage)**\n  * [Amazon](docs/providers/amazon.md#using-storage)\n  * [Azure](docs/providers/azure.md#using-storage)\n  * [Google](docs/providers/google.md)\n  * [HP](docs/providers/hp/storage.md)\n  * [Openstack](docs/providers/openstack/storage.md)\n  * [Rackspace](docs/providers/rackspace/storage.md)\n* **[Database](#databases)**\n  * [Rackspace](docs/providers/rackspace/database.md)\n* **[DNS](#dns----beta)** *(beta)*\n  * [Rackspace](docs/providers/rackspace/dns.md)\n* **[Block Storage](#block-storage----beta)** *(beta)*\n  * [Rackspace](docs/providers/rackspace/blockstorage.md)\n  * [Openstack](docs/providers/openstack/blockstorage.md)\n* **[Load Balancers](#load-balancers----beta)** *(beta)*\n  * [Rackspace](docs/providers/rackspace/loadbalancer.md)\n* **[Orchestration](#orchestration----beta)** *(beta)*\n  * [Openstack](docs/providers/openstack/orchestration.md)\n  * [Rackspace](docs/providers/rackspace/orchestration.md)\n* **[Network](#network----beta)** *(beta)*\n  * [HP](docs/providers/hp/network.md)\n  * [Openstack](docs/providers/openstack/network.md)\n  * [Rackspace](docs/providers/rackspace/network.md)\n* **[CDN](#cdn----beta)** *(beta)*\n  * [Openstack](docs/providers/openstack/cdn.md)\n  * [Rackspace](docs/providers/rackspace/cdn.md)\n\n## Compute\n\nThe `pkgcloud.compute` service is designed to make it easy to provision and work with VMs. To get started with a `pkgcloud.compute` client just create one:\n\n``` js\n  var client = require('pkgcloud').compute.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\nEach compute provider takes different credentials to authenticate; these details about each specific provider can be found below:\n\n* [Amazon](docs/providers/amazon.md#using-compute)\n* [Azure](docs/providers/azure.md#using-compute)\n* [DigitalOcean](docs/providers/digitalocean.md#using-compute)\n* [HP](docs/providers/hp/compute.md)\n* [Openstack](docs/providers/openstack/compute.md)\n* [Rackspace](docs/providers/rackspace/compute.md)\n\nEach instance of `pkgcloud.compute.Client` returned from `pkgcloud.compute.createClient` has a set of uniform APIs:\n\n### Server\n* `client.getServers(function (err, servers) { })`\n* `client.createServer(options, function (err, server) { })`\n* `client.destroyServer(serverId, function (err, server) { })`\n* `client.getServer(serverId, function (err, server) { })`\n* `client.rebootServer(server, function (err, server) { })`\n\n### Image\n* `client.getImages(function (err, images) { })`\n* `client.getImage(imageId, function (err, image) { })`\n* `client.destroyImage(image, function (err, ok) { })`\n* `client.createImage(options, function (err, image) { })`\n\n### Flavor\n* `client.getFlavors(function (err, flavors) { })`\n* `client.getFlavor(flavorId, function (err, flavor) { })`\n\n## Storage\n\nThe `pkgcloud.storage` service is designed to make it easy to upload and download files to various infrastructure providers. **_Special attention has been paid so that methods are streams and pipe-capable._**\n\nTo get started with a `pkgcloud.storage` client just create one:\n\n``` js\n  var client = require('pkgcloud').storage.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\nEach storage provider takes different credentials to authenticate; these details about each specific provider can be found below:\n\n* [Amazon](docs/providers/amazon.md#using-storage)\n* [Azure](docs/providers/azure.md#using-storage)\n* [Google](docs/providers/google.md#using-storage)\n* [HP](docs/providers/hp/storage.md)\n* [Openstack](docs/providers/openstack/storage.md)\n* [Rackspace](docs/providers/rackspace/storage.md)\n\nEach instance of `pkgcloud.storage.Client` returned from `pkgcloud.storage.createClient` has a set of uniform APIs:\n\n### Container\n* `client.getContainers(function (err, containers) { })`\n* `client.createContainer(options, function (err, container) { })`\n* `client.destroyContainer(containerName, function (err) { })`\n* `client.getContainer(containerName, function (err, container) { })`\n\n### File\n* `client.upload(options)`\n* `client.download(options, function (err) { })`\n* `client.getFiles(container, function (err, files) { })`\n* `client.getFile(container, file, function (err, server) { })`\n* `client.removeFile(container, file, function (err) { })`\n\nBoth the `.upload(options)` and `.download(options)` have had **careful attention paid to make sure they are pipe and stream capable:**\n\n### Upload a File\n``` js\n  var pkgcloud = require('pkgcloud'),\n      fs = require('fs');\n\n  var client = pkgcloud.storage.createClient({ /* ... */ });\n\n  var readStream = fs.createReadStream('a-file.txt');\n  var writeStream = client.upload({\n    container: 'a-container',\n    remote: 'remote-file-name.txt'\n  });\n\n  writeStream.on('error', function(err) {\n    // handle your error case\n  });\n\n  writeStream.on('success', function(file) {\n    // success, file will be a File model\n  });\n\n  readStream.pipe(writeStream);\n```\n\n### Download a File\n``` js\n  var pkgcloud = require('pkgcloud'),\n      fs = require('fs');\n\n  var client = pkgcloud.storage.createClient({ /* ... */ });\n\n  client.download({\n    container: 'a-container',\n    remote: 'remote-file-name.txt'\n  }).pipe(fs.createWriteStream('a-file.txt'));\n```\n\n## Databases\n\nThe `pkgcloud.database` service is designed to consistently work with a variety of Database-as-a-Service (DBaaS) providers.\n\nTo get started with a `pkgcloud.storage` client just create one:\n\n``` js\n  var client = require('pkgcloud').database.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\nEach database provider takes different credentials to authenticate; these details about each specific provider can be found below:\n\n* **MySQL**\n  * [Rackspace](docs/providers/rackspace/databases.md)\n* **Azure Tables**\n  * [Azure](docs/providers/azure.md#database)\n\nDue to the various differences in how these DBaaS providers provision databases only a small surface area of the API for instances of `pkgcloud.database.Client` returned from `pkgcloud.database.createClient` is consistent across all providers:\n\n* `client.create(options, callback)`\n\nAll of the individual methods are documented for each DBaaS provider listed above.\n\n## DNS -- Beta\n\n##### Note: DNS is considered Beta until there are multiple providers; presently only Rackspace are supported.\n\nThe `pkgcloud.dns` service is designed to make it easy to manage DNS zones and records on various infrastructure providers. **_Special attention has been paid so that methods are streams and pipe-capable._**\n\nTo get started with a `pkgcloud.dns` client just create one:\n\n``` js\n  var client = require('pkgcloud').dns.createClient({\n    //\n    // The name of the provider (e.g. \"rackspace\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n#### Providers\n\n* [Rackspace](docs/providers/rackspace/dns.md)\n\nEach instance of `pkgcloud.dns.Client` returned from `pkgcloud.dns.createClient` has a set of uniform APIs:\n\n### Zone\n* `client.getZones(details, function (err, zones) { })`\n* `client.getZone(zone, function (err, zone) { })`\n* `client.createZone(details, function (err, zone) { })`\n* `client.updateZone(zone, function (err) { })`\n* `client.deleteZone(zone, function (err) { })`\n\n### Record\n* `client.getRecords(zone, function (err, records) { })`\n* `client.getRecord(zone, record, function (err, record) { })`\n* `client.createRecord(zone, record, function (err, record) { })`\n* `client.updateRecord(zone, record, function (err, record) { })`\n* `client.deleteRecord(zone, record, function (err) { })`\n\n## Block Storage -- Beta\n\n##### Note: Block Storage is considered Beta until there are multiple providers; presently only Openstack and Rackspace are supported.\n\nThe `pkgcloud.blockstorage` service is designed to make it easy to create and manage block storage volumes and snapshots.\n\nTo get started with a `pkgcloud.blockstorage` client just create one:\n\n``` js\n  var client = require('pkgcloud').blockstorage.createClient({\n    //\n    // The name of the provider (e.g. \"rackspace\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n#### Providers\n\n* [Rackspace](docs/providers/rackspace/blockstorage.md)\n* [Openstack](docs/providers/openstack/blockstorage.md)\n\nEach instance of `pkgcloud.blockstorage.Client` returned from `pkgcloud.blockstorage.createClient` has a set of uniform APIs:\n\n### Volume\n* `client.getVolumes(options, function (err, volumes) { })`\n* `client.getVolume(volume, function (err, volume) { })`\n* `client.createVolume(details, function (err, volume) { })`\n* `client.updateVolume(volume, function (err, volume) { })`\n* `client.deleteVolume(volume, function (err) { })`\n\n### Snapshot\n* `client.getSnapshots(options, function (err, snapshots) { })`\n* `client.getSnapshot(snapshot, function (err, snapshot) { })`\n* `client.createSnapshot(details, function (err, snapshot) { })`\n* `client.updateSnapshot(snapshot, function (err, snapshot) { })`\n* `client.deleteSnapshot(snapshot, function (err) { })`\n\n## Load Balancers -- Beta\n\n##### Note: Load Balancers is considered Beta until there are multiple providers; presently only Rackspace are supported.\n\nThe `pkgcloud.loadbalancer` service is designed to make it easy to create and manage block storage volumes and snapshots.\n\nTo get started with a `pkgcloud.loadbalancer` client just create one:\n\n``` js\n  var client = require('pkgcloud').loadbalancer.createClient({\n    //\n    // The name of the provider (e.g. \"rackspace\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n#### Providers\n\n* [Rackspace](docs/providers/rackspace/loadbalancer.md)\n\nEach instance of `pkgcloud.loadbalancer.Client` returned from `pkgcloud.loadbalancer.createClient` has a set of uniform APIs:\n\n### LoadBalancers\n* `client.getLoadBalancers(options, function (err, loadBalancers) { })`\n* `client.getLoadBalancer(loadBalancer, function (err, loadBalancer) { })`\n* `client.createLoadBalancer(details, function (err, loadBalancer) { })`\n* `client.updateLoadBalancer(loadBalancer, function (err) { })`\n* `client.deleteLoadBalancer(loadBalancer, function (err) { })`\n\n### Nodes\n* `client.getNodes(loadBalancer, function (err, nodes) { })`\n* `client.addNodes(loadBalancer, nodes, function (err, nodes) { })`\n* `client.updateNode(loadBalancer, node, function (err) { })`\n* `client.removeNode(loadBalancer, node, function (err) { })`\n\n## Network -- Beta\n\n##### Note: Network is considered Beta until there are multiple providers; presently only HP \u0026 Openstack providers are supported.\n\nThe `pkgcloud.network` service is designed to make it easy to create and manage networks.\n\nTo get started with a `pkgcloud.network` client just create one:\n\n``` js\n  var client = require('pkgcloud').network.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n#### Providers\n\n* [HP](docs/providers/hp/network.md)\n* [Openstack](docs/providers/openstack/network.md)\n* [Rackspace](docs/providers/rackspace/network.md)\n\n\nEach instance of `pkgcloud.network.Client` returned from `pkgcloud.network.createClient` has a set of uniform APIs:\n\n### Networks\n* `client.getNetworks(options, function (err, networks) { })`\n* `client.getNetwork(network, function (err, network) { })`\n* `client.createNetwork(options, function (err, network) { })`\n* `client.updateNetwork(network, function (err, network) { })`\n* `client.deleteNetwork(network, function (err, networkId) { })`\n\n### Subnets\n* `client.getSubnets(options, function (err, subnets) { })`\n* `client.getSubnet(subnet, function (err, subnet) { })`\n* `client.createSubnet(options, function (err, subnet) { })`\n* `client.updateSubnet(subnet, function (err, subnet) { })`\n* `client.deleteSubnet(subnet, function (err, subnetId) { })`\n\n### Ports\n* `client.getPorts(options, function (err, ports) { })`\n* `client.getPort(port, function (err, port) { })`\n* `client.createPort(options, function (err, port) { })`\n* `client.updatePort(port, function (err, port) { })`\n* `client.deletePort(port, function (err, portId) { })`\n\n## Orchestration -- Beta\n\n##### Note: Orchestration is considered Beta until there are multiple providers; presently only Openstack are supported.\n\nThe `pkgcloud.orchestration` service is designed to allow you to access Openstack Heat via node.js. You can manage stacks and resources from within any node.js application.\n\nTo get started with a `pkgcloud.orchestration` client just create one:\n\n``` js\n  var client = require('pkgcloud').orchestration.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n#### Providers\n\n* [Openstack](docs/providers/openstack/orchestration.md)\n* [Rackspace](docs/providers/rackspace/orchestration.md)\n\nEach instance of `pkgcloud.orchestration.Client` returned from `pkgcloud.orchestration.createClient` has a set of uniform APIs:\n\n### Stack\n* `client.getStack(stack, function (err, stack) { })`\n* `client.getStacks(options, function (err, stacks) { })`\n* `client.createStack(details, function (err, stack) { })`\n* `client.previewStack(details, function (err, stack) { })`\n* `client.adoptStack(details, function (err, stack) { })`\n* `client.updateStack(stack, function (err, stack) { })`\n* `client.deleteStack(stack, function (err) { })`\n* `client.abandonStack(stack, function (err, abandonedStack) { })`\n* `client.getTemplate(stack, function (err, template) { })`\n\n### Resources\n* `client.getResource(stack, resource, function (err, resource) { })`\n* `client.getResources(stack, function (err, resources) { })`\n* `client.getResourceTypes(function (err, resourceTypes) { })`\n* `client.getResourceSchema(resourceType, function (err, resourceSchema) { })`\n* `client.getResourceTemplate(resourceType, function (err, resourceTemplate) { })`\n\n### Events\n* `client.getEvent(stack, resource, eventId, function (err, event) { })`\n* `client.getEvents(stack, function (err, events) { })`\n* `client.getResourceEvents(stack, resource, function (err, events) { })`\n\n### Templates\n* `client.validateTemplate(template, function (err, template) { })`\n\n## CDN -- Beta\n\n##### Note: CDN is considered Beta until there are multiple providers; presently only Openstack and Rackspace are supported.\n\nThe `pkgcloud.cdn` service is designed to allow you to access Openstack Poppy via node.js. You can manage services and flavors from within any node.js application.\n\nTo get started with a `pkgcloud.cdn` client just create one:\n\n``` js\n  var client = require('pkgcloud').cdn.createClient({\n    //\n    // The name of the provider (e.g. \"openstack\")\n    //\n    provider: 'provider-name',\n\n    //\n    // ... Provider specific credentials\n    //\n  });\n```\n\n#### Providers\n\n* [Openstack](docs/providers/openstack/cdn.md)\n* [Rackspace](docs/providers/rackspace/cdn.md)\n\nEach instance of `pkgcloud.cdn.Client` returned from `pkgcloud.cdn.createClient` has a set of uniform APIs:\n\n### Base\n* `client.getHomeDocument(function (err, homeDocument) { })`\n* `client.getPing(function (err) { })`\n\n### Service\n* `client.getService(service, function (err, service) { })`\n* `client.getServices(options, function (err, services) { })`\n* `client.createService(details, function (err, service) { })`\n* `client.updateService(service, function (err, service) { })`\n* `client.deleteService(service, function (err) { })`\n\n### Service Assets\n* `client.deleteServiceCachedAssets(service, assetUrl, function(err) { })`\n\n### Flavors\n* `client.getFlavor(flavor, function (err, flavor) { })`\n* `client.getFlavors(options, function (err, flavors) { })`\n\n## Installation\n\n``` bash\n  $ npm install pkgcloud\n```\n\n## Tests\nTo run the tests you will need `mocha@1.9.x` or higher.  You may install all\nthe requirements with:\n``` bash\n $ npm install\n```\nThen run the tests:\n\n``` bash\n $ npm test\n```\n\nThe tests use the [`hock`](https://github.com/mmalecki/hock) library for mock up the response of providers, so the tests run without do any connection to the providers, there is a notorius advantage of speed on that, also you can run the tests without Internet connection and also can highlight a change of API just disabling `hock`.\n\n\n### Running tests without mocks\nBy default the `npm test` command run the tests enabling `hock`. And sometimes you will want to test against the live provider, so you need to do this steps, in order to test without mocks.\n\n1. Copy a provider config file from `test/configs/mock` to `test/configs`\n2. Fill in with your own credentials for the provider.\n3. (Optional) The compute test suite run the common tests for all providers listed on `test/configs/providers.json`, there you can enable or disable providers.\n4. Run the tests using mocha.\n\n``` bash\nMocha installed globally\n $ mocha -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n\nLinux/Mac - Mocha installed locally\n $ ./node_modules/.bin/mocha -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n\nWindows - Mocha installed locally:\n $ node_modules\\.bin\\mocha.cmd -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n\n```\n\n### Other ways to run the tests\nAlso you can run the tests directly using `mocha` with `hock` enabled:\n\n``` bash\nLinux/Mac - Mocha installed globally:\n $ MOCK=on mocha -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n\nLinux/Mac - Mocha installed locally:\n $ MOCK=on node_modules/.bin/mocha -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n\nWindows - Mocha installed globally:\n $ set MOCK=on\u0026mocha -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n\nWindows - Mocha installed locally:\n $ set MOCK=on\u0026node_modules\\.bin\\mocha.cmd -R spec test/*/*/*-test.js test/*/*/*/*-test.js\n```\n\nEven better, you can run the tests for some specific provider:\n\n``` bash\nLinux/Mac - Mocha installed globally:\n $ MOCK=on mocha -R spec test/openstack/*/*-test.js\n\nLinux/Mac - Mocha installed locally:\n $ MOCK=on ./node_modules/.bin/mocha -R spec test/openstack/*/*-test.js\n\nWindows - Mocha installed globally:\n $ set MOCK=on\u0026mocha -R spec test/openstack/*/*-test.js\n\nWindows - Mocha installed locally:\n $ set MOCK=on\u0026node_modules\\.bin\\mocha.cmd -R spec test/openstack/*/*-test.js\n\n```\n\n## Logging\nAny client you create with `createClient` can emit logging events. If you're interested in more detail from the internals of `pkgcloud`, you can wire up an event handler for log events.\n\n```Javascript\nvar client = pkgcloud.compute.createClient(options);\n\nclient.on('log::*', function(message, object) {\n  if (object) {\n   console.log(this.event.split('::')[1] + ' ' + message);\n   console.dir(object);\n  }\n  else {\n    console.log(this.event.split('::')[1]  + ' ' + message);\n  }\n});\n\n```\n\nThe valid log events raised are `log::debug`, `log::verbose`, `log::info`, `log::warn`, and `log::error`. There is also a [more detailed logging example using pkgcloud with Winston](docs/logging-with-winston.md).\n\n## Code Coverage\n\n### Run Coverage locally and send to coveralls.io\n\nTravis takes care of coveralls, so this shouldn't be necessary unless you're\ntroubleshooting a problem with Travis / Coveralls. You'll need to have access\nto the coveralls `repo_token`, which should only be visible to\n`pkgcloud/pkgcloud` admins.\n\n1. Create a `.coveralls.yml` containing the `repo_token` from\n   https://coveralls.io/r/pkgcloud/pkgcloud\n2. Run the following:\n```\nnpm test\nnpm run coverage\n```\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\n## Contribute!\nWe welcome contribution to `pkgcloud` by any and all individuals or organizations. Before contributing please take a look at the [Contribution Guidelines in CONTRIBUTING.md](CONTRIBUTING.md).\n\nWe are pretty flexible about these guidelines, but the closer you follow them the more likely we are to merge your pull-request.\n\n#### Author: [Charlie Robbins](https://github.com/indexzero)\n#### Contributors: [Ross Kukulinski](https://github.com/rosskukulinski), [Jarrett Cruger](https://github.com/jcrugzz), [Ken Perkins](https://github.com/kenperkins)\n#### License: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkgcloud%2Fpkgcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkgcloud%2Fpkgcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkgcloud%2Fpkgcloud/lists"}