docs/apidocs/cloud-api-source/source/includes/provider.md

2.6 KiB

Providers

Provider

Example

{
    "available": true,
    "label": "Digital Ocean",
    "name": "digitalocean",
    "regions": [
        "/api/infra/v1/region/digitalocean/ams1/",
        "/api/infra/v1/region/digitalocean/ams2/",
        "/api/infra/v1/region/digitalocean/ams3/",
        "/api/infra/v1/region/digitalocean/lon1/",
        "/api/infra/v1/region/digitalocean/nyc1/",
        "/api/infra/v1/region/digitalocean/nyc2/",
        "/api/infra/v1/region/digitalocean/nyc3/",
        "/api/infra/v1/region/digitalocean/sfo1/",
        "/api/infra/v1/region/digitalocean/sgp1/"
    ],
    "resource_uri": "/api/infra/v1/provider/digitalocean/"
}

A provider is a representation of a cloud provider supported by Docker Cloud. Providers have one or more regions where nodes are deployed.

Attributes

Attribute Description
resource_uri A unique API endpoint that represents the provider
name A unique identifier for the provider
label A user-friendly name for the provider
regions A list of resource URIs of the regions available in this provider
available Whether the provider is currently available for new node deployments

List all providers

import dockercloud

providers = dockercloud.Provider.list()
GET /api/infra/v1/provider/ HTTP/1.1
Host: cloud.docker.com
Authorization: Basic dXNlcm5hbWU6YXBpa2V5
Accept: application/json
import "github.com/docker/go-dockercloud/dockercloud"

providerList, err := dockercloud.ListProviders()

if err != nil {
  log.Println(err)
}

log.Println(providerList)
docker-cloud nodecluster provider

Lists all supported cloud providers. Returns a list of Provider objects.

Endpoint Type

Available in Docker Cloud's REST API

HTTP Request

GET /api/infra/v1/provider/

Query Parameters

Parameter Description
name Filter by provider name

Get an individual provider

import dockercloud

provider = dockercloud.Provider.fetch("digitalocean")
import "github.com/docker/go-dockercloud/dockercloud"

provider, err := dockercloud.GetProvider("digitalocean")

if err != nil {
  log.Println(err)
}

log.Println(provider)
GET /api/infra/v1/provider/digitalocean/ HTTP/1.1
Host: cloud.docker.com
Authorization: Basic dXNlcm5hbWU6YXBpa2V5
Accept: application/json

Get all the details of a specific provider

Endpoint Type

Available in Docker Cloud's REST API

HTTP Request

GET /api/infra/v1/provider/(name)/

Path Parameters

Parameter Description
name The name of the provider to retrieve