Provider and connection APIs

This section includes all provider and connection related APIs with examples.

Create a provider

POST to create a provider.

curl -k -X POST -H "Authorization: Bearer ${CAM_BEARER_TOKEN}" -H "Content-Type: application/json" -H "Accept: application/json" -d @cc_create.json "https://${CAM_HOST}:<CAM_PORT>/cam/api/v1/providers?tenantId=${CAM_TENANT_ID}&ace_orgGuid=${ICP_TEAM}

Example response:

[
    {
        "configuration_parameters": [],
        "connection_parameters": [
            {
                "name": "bluemix_api_key",
                "type": "password",
                "description": "The API key for IBM Cloud",
                "required": "false",
                "secured": "true",
                "label": "IBM Cloud API Key",
                "value": ""
            },
            {
                "name": "softlayer_username",
                "type": "string",
                "description": "The User Name for SoftLayer",
                "required": "false",
                "secured": "false",
                "label": "SoftLayer User Name"
            },
            {
                "name": "softlayer_api_key",
                "type": "password",
                "description": "The API key for SoftLayer",
                "required": "false",
                "secured": "true",
                "label": "SoftLayer API Key",
                "value": ""
            }
        ],
        "name": "IBM",
        "description": "IBM Provider",
        "datatype_identifier": "IBM",
        "id": "5c588624df7d9e00187628c7",
        "label": "IBM"
    },
...

Create a cloud connection

POST to create a cloud connection.

curl -k -X POST -H "Authorization: Bearer ${CAM_BEARER_TOKEN}" -H "Content-Type: application/json" -H "Accept: application/json" -d @cc_create.json "https://${CAM_HOST}:<CAM_PORT>/cam/api/v1/cloudconnections?tenantId=${CAM_TENANT_ID}&ace_orgGuid=${ICP_TEAM}&cloudOE_spaceGuid=${ICP_NAMESPACE}"

cc_create.json

{
  "name": "AWSTestConnection",
  "description": "My AWS Test Connection",
  "connection_parameters": [
    {
      "name": "aws_access_key_id",
      "type": "string",
      "description": "The API Access Key ID for AWS generated in the Identity and Access Management (IAM) service",
      "required": "true",
      "secured": "true",
      "label": "Access Key ID",
      "default": null,
      "options": null,
      "value": "1234"
    },
    {
      "name": "aws_secret_key",
      "type": "password",
      "description": "The API Secret Access Key for AWS generated in the Identity and Access Management (IAM) service",
      "required": "true",
      "secured": "true",
      "label": "Secret Access Key",
      "default": null,
      "options": null,
      "value": "5678"
    },
    {
      "name": "aws_default_region",
      "type": "string",
      "description": "Region to deploy the service on.",
      "required": "true",
      "secured": "false",
      "label": "AWS Region",
      "default": null,
      "options": [
        {
          "label": "US East (Northern Virginia)",
          "value": "us-east-1",
          "default": "true"
        },
        {
          "label": "US East (Ohio) Region",
          "value": "us-east-2"
        },
        {
          "label": "US West (Northern California)",
          "value": "us-west-1"
        },
        {
          "label": "US West (Oregon) Region",
          "value": "us-west-2"
        },
        {
          "label": "Asia Pacific (Seoul) Region",
          "value": "ap-northeast-2"
        },
        {
          "label": "Asia Pacific (Singapore) Region",
          "value": "ap-southeast-1"
        },
        {
          "label": "Asia Pacific (Sydney) Region",
          "value": "ap-southeast-2"
        },
        {
          "label": "Asia Pacific (Tokyo) Region",
          "value": "ap-northeast-1"
        },
        {
          "label": "EU (Frankfurt) Region",
          "value": "eu-central-1"
        },
        {
          "label": "EU (Ireland) Region",
          "value": "eu-west-1"
        },
        {
          "label": "EU (London) Region",
          "value": "eu-west-2"
        },
        {
          "label": "AWS GovCloud (US)",
          "value": "us-gov-west-1"
        }
      ],
      "value": "us-east-1"
    }
  ],
  "configuration_parameters": [

  ],
  "providerId": "5bb76eb78e04ec001c19466f",
  "additional_Parameters": [
    {
      "plugin": "plugin-terraform",
      "supported_api_types": [
        "stack",
        "iaas"
      ],
      "supported_template_types": [
        {
          "template_type": "Terraform",
          "template_formats": [
            "JSON",
            "HCL"
          ]
        }
      ],
      "configuration_parameters": [

      ]
    }
  ]
}

GET the list of cloud connections

curl -k -X GET -H "Authorization: Bearer ${CAM_BEARER_TOKEN}" "https://${CAM_HOST}:<CAM_PORT>/cam/api/v1/cloudconnections?tenantId=${CAM_TENANT_ID}&ace_orgGuid=${ICP_TEAM}&cloudOE_spaceGuid=${ICP_NAMESPACE}"

Example output:

[
    {
        "name": "MyVMware",
        "description": "My VMware vSphere Connection",
        "connection_parameters": [
            {
                "name": "vsphere_user",
                "value": "username@vsphere.local",
                "secured": "false"
            },
            {
                "name": "vsphere_password",
                "value": "*****",
                "secured": "true"
            },
            {
                "name": "vsphere_server",
                "value": "1.2.3.4",
                "secured": "false"
            }
        ],
        "validate": true,
        "message": "",
        "id": "59f3b11bd1b007002263c5f3",
        "providerId": "59f38667d1b007002263c578",
        "additional_Parameters": {
            "0": {
                "plugin": "plugin-terraform"
            }
        },
        "tenantId": "5c0e0a5e-d431-468c-9a11-a3df3978e424"
    }
]

The cloudOE_spaceGuid query parameter is optional and the search results display all cloud connections that $ICP_NAMESPACE resolves to.

GET a specific cloud connection (filter)

curl -k -X GET -H "Authorization: Bearer ${CAM_BEARER_TOKEN}" "https://${CAM_HOST}:<CAM_PORT>/cam/api/v1/cloudconnections?tenantId=${CAM_TENANT_ID}&ace_orgGuid=${ICP_TEAM}&filter=%7B%22where%22%3A%20%7B%22name%22%3A%20%22vmware.octravis%22%20%7D%7D"

Example Output:

[
  {
    "name": "vmware.octravis",
    "description": "vmware.octravis",
    "connection_parameters": [
      {
        "name": "vsphere_user",
        "value": "octravis@vsphere.local",
        "secured": "false"
      },
      {
        "name": "vsphere_password",
        "value": "*****",
        "secured": "true"
      },
      {
        "name": "vsphere_server",
        "value": "1.2.3.123",
        "secured": "false"
      }
    ],
    "configuration_parameters": [
      {
        "name": "",
        "value": ""
      }
    ],
    "validate": true,
    "message": "",
    "id": "5a4d094a47ff9c0022728759",
    "providerId": "5a4cf14b47ff9c0022728676",
    "additional_Parameters": [
      {
        "plugin": "plugin-terraform"
      }
    ],
    "tenantId": "15e7d67e-9f73-43cd-9759-b39ebeea85e8"
  }
]