Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 4.4

Skip to end of metadata
Go to start of metadata

Contents:

Credentials resource

This resource is used to manage the credentials of enterprises for public cloud providers. If an administrator has allowed an enterprise to use a provider region and the enterprise has valid credentials for the provider, then the enterprise will be able to use that provider region. 

Main URI of the Resource

This class operates mainly over the Resource URI: /admin/enterprises/{enterprise}/credentials

Exposed Methods

List credentials of an enterprise

Retrieve the credentials of an enterprise, for all existing remote providers.

Synopsis: GET http://example.com/api/admin/enterprises/{enterprise}/credentials
Roles Required: USERS_MANAGE_ENTERPRISE, USERS_MANAGE_USERS
Request Headers: Accept:  application/vnd.abiquo.publiccloudcredentialslist+json; version=4.4; application/vnd.abiquo.publiccloudcredentialslist+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

    

Request Message Body Entity: 
Response Message Body Entity: Credentials Media Type
Request Example:

 Click here to show or hide the request example

GET_adm_ents_X_creds_AC_pccredsslst_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/5414/credentials \ 
	 -H 'Accept:application/vnd.abiquo.publiccloudcredentialslist+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [], 
  "collection": []
}

Get credentials
curl --verbose -X GET -H "Accept: application/vnd.abiquo.publiccloudcredentialslist+json" http://examplehost/api/admin/enterprises/3/credentials -u user:pass  | pjson 
> GET /api/admin/enterprises/3/credentials HTTP/1.1
> Accept: application/vnd.abiquo.publiccloudcredentialslist+json
> 
< HTTP/1.1 200 OK
< Content-Type: application/vnd.abiquo.publiccloudcredentialslist+json

{
  "collection": [
    {
      "access": "XXXXXXXXXXXXXXXXXX", 
      "id": 1, 
      "links": [
        {
          "href": "http://examplehost/api/admin/enterprises/3", 
          "rel": "enterprise", 
          "title": "exampleenterprise", 
          "type": "application/vnd.abiquo.enterprise+json"
        }, 
        {
          "href": "http://examplehost/api/admin/enterprises/3/credentials/1", 
          "rel": "edit", 
          "title": "edit public cloud credentials", 
          "type": "application/vnd.abiquo.publiccloudcredentials+json"
        },
        {
          "href": "http://examplehost/api/config/hypervisortypes/PUBLICCLOUDPROVIDER", 
          "rel": "provider", 
          "title": "provider", 
          "type": "application/vnd.abiquo.hypervisortype+json"
        }
      ]
    },
    {
      "access": "ZZZZZZZZZZZZZZZZZZZZ", 
      "id": 2, 
      "links": [
        {
          "href": "http://examplehost/api/admin/enterprises/3", 
          "rel": "enterprise", 
          "title": "exampleenterprise", 
          "type": "application/vnd.abiquo.enterprise+json"
        }, 
        {
          "href": "http://examplehost/api/admin/enterprises/3/credentials/2", 
          "rel": "edit", 
          "title": "edit public cloud credentials", 
          "type": "application/vnd.abiquo.publiccloudcredentials+json"
        },
        {
          "href": "http://examplehost/api/config/hypervisortypes/OTHERPROVIDER", 
          "rel": "provider", 
          "title": "provider", 
          "type": "application/vnd.abiquo.hypervisortype+json"
        }
      ]
    }
  ], 
  "links": []
}

Add credentials to an enterprise

Adds credentials for an enterprise and a remote provider. The credentials must be valid and the enterprise cannot have more than one set of credentials for the same provider. The credentials must be unique in the system, so two enterprises cannot use the same access and key pair for the same provider.

Synopsis: POST http://example.com/api/admin/enterprises/{enterprise}/credentials
Roles Required: USERS_MANAGE_ENTERPRISE, USERS_MANAGE_USERS
Request Headers: Accept: application/vnd.abiquo.publiccloudcredentialslist+json; version=4.4; application/vnd.abiquo.publiccloudcredentialslist+xml; version=4.4;  Content-type:  application/vnd.abiquo.publiccloudcredentialslist+json; version=4.4; application/vnd.abiquo.publiccloudcredentialslist+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:  Credentials Media Type
Response Message Body Entity: Credentials Media Type
Request Example:

 Click here to show or hide the request example

POST_adm_ents_X_creds_CT_pccredss_j_AC_pccredss_j.0001.txt

cURL:

curl -X POST http://localhost:9000/api/admin/enterprises/1026/credentials \ 
	 -H 'Accept:application/vnd.abiquo.publiccloudcredentials+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.publiccloudcredentials+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 201

Request payload:

{
  "access": "2f269c27-5bc4-442d-9ab4-d155d71f7bf3", 
  "key": "504947ff-7c3f-46b5-93a9-b6578b818d22", 
  "links": [
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/CP_TEST", 
      "rel": "hypervisortype"
    }
  ]
}

Response payload:

{
  "access": "88881450a827dd615057e177472945a8547c2f07aee39a0ac9c8e17a3b1fbbad9e129bb2b771baa05e04d7640ea78eb3", 
  "id": 73, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/1026", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "105"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/1026/credentials/73", 
      "type": "application/vnd.abiquo.publiccloudcredentials+json", 
      "rel": "edit", 
      "title": "edit public cloud credentials"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/CP_TEST", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "CP_TEST"
    }
  ]
}

Add credentials
curl --verbose -X POST -H "Content-type: application/vnd.abiquo.publiccloudcredentials+json" -H "Accept: application/vnd.abiquo.publiccloudcredentials+json" http://examplehost/api/admin/enterprises/3/credentials -u user:pass -d @credentials.json | pjson
> POST /api/admin/enterprises/3/credentials HTTP/1.1
> Accept: application/vnd.abiquo.publiccloudcredentialslist+json
> Content-Type: application/vnd.abiquo.publiccloudcredentials+json
> 
< HTTP/1.1 201 CREATED
< Content-Type: application/vnd.abiquo.publiccloudcredentials+json

{
    "access": "XXXXXXXXXXXXXXXXXX",
    "id": 1,
    "links": [
        {
            "href": "http://examplehost/api/admin/enterprises/3",
            "rel": "enterprise",
            "title": "exampleenterprise",
            "type": "application/vnd.abiquo.enterprise+json"
        },
        {
            "href": "http://examplehost/api/admin/enterprises/3/credentials/1",
            "rel": "edit",
            "title": "edit public cloud credentials",
            "type": "application/vnd.abiquo.publiccloudcredentials+json"
        },
        {
          "href": "http://examplehost/api/config/hypervisortypes/PUBLICCLOUDPROVIDER", 
          "rel": "provider", 
          "title": "provider", 
          "type": "application/vnd.abiquo.hypervisortype+json"
        }
    ]
}

Request Body:

 Click here to show or hide the request example
credentials.json
{
 "access": "XXXXXXXXXXXXXXXXXX",
 "key": "yyyyyyyyyyyyyyyy",
 "links": [
        {
          "href": "http://examplehost/api/config/hypervisortypes/PUBLICCLOUDPROVIDER", 
          "rel": "provider", 
          "title": "provider", 
          "type": "application/vnd.abiquo.hypervisortype+json"
        }
    ]
}

Get a set of credentials from an enterprise

Retrieve the credentials of an enterprise for a single remote provider.

Synopsis: GET  http://example.com/api/admin/enterprises/{enterprise}/credentials/{credentials}  
Roles Required: USERS_MANAGE_ENTERPRISE, USERS_MANAGE_USERS
Request Headers: Accept:  application/vnd.abiquo.publiccloudcredentialslist+json; version=4.4; application/vnd.abiquo.publiccloudcredentialslist+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:
Response Message Body Entity:  Credentials Media Type
Request Example:

 Click here to show or hide the request example

GET_adm_ents_X_creds_X_AC_pccredss_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/admin/enterprises/4441/credentials/691 \ 
	 -H 'Accept:application/vnd.abiquo.publiccloudcredentials+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "access": "192c643b032d0c2dd27786e8341fe5f0", 
  "id": 691, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4441", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "107"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4441/credentials/691", 
      "type": "application/vnd.abiquo.publiccloudcredentials+json", 
      "rel": "edit", 
      "title": "edit public cloud credentials"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/CP_TEST", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "CP_TEST"
    }
  ]
}

Get credentials
curl --verbose -X GET -H "Accept: application/vnd.abiquo.publiccloudcredentials+json" http://examplehost/api/admin/enterprises/3/credentials/1 -u user:pass  | pjson 
> GET /api/admin/enterprises/3/credentials/1 HTTP/1.1
> Accept: application/vnd.abiquo.publiccloudcredentials+json
> 
< HTTP/1.1 200 OK
< Content-Type: application/vnd.abiquo.publiccloudcredentials+json


{
  "access": "XXXXXXXXXXXXXXXXXX", 
  "id": 1, 
  "links": [
    {
      "href": "http://examplehost/api/admin/enterprises/3", 
      "rel": "exampleenterprise", 
      "title": "Jose_ENT", 
      "type": "application/vnd.abiquo.enterprise+json"
    }, 
    {
      "href": "http://examplehost/api/admin/enterprises/3/credentials/1", 
      "rel": "edit", 
      "title": "edit public cloud credentials", 
      "type": "application/vnd.abiquo.publiccloudcredentials+json"
    },
    {
      "href": "http://examplehost/api/config/hypervisortypes/PUBLICCLOUDPROVIDER", 
      "rel": "provider", 
      "title": "provider", 
      "type": "application/vnd.abiquo.hypervisortype+json"
    }
  ]
}

Delete a set of credentials from an enterprise

Allow an enterprise to remove the credentials for a provider.

This action won't affect other resources, like virtual datacenters, virtual machines, which won't be deleted on Abiquo neither in the remote provider.

Synopsis: DELETE  http://example.com/api/admin/enterprises/{enterprise}/credentials/{credentials}
Roles Required: USERS_MANAGE_ENTERPRISE, USERS_MANAGE_USERS 
Request Headers: 
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity: 
Response Message Body Entity:
Request Example:

 Click here to show or hide the request example

DELETE_adm_ents_X_creds_X.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/admin/enterprises/2324/credentials/164 \ 
	 -H 'Accept:text/json,application/json' \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Delete credentials
curl --verbose -X DELETE http://examplehost/api/admin/enterprises/3/credentials/1 -u user:pass 
< HTTP/1.1 204 NO CONTENT

Update a set of credentials of an enterprise

Updates the credentials of an enterprise for a provider. The new credentials must be valid.

Synopsis: PUT http://example.com/api/admin/enterprises/{enterprise}/credentials/{credentials}
Roles Required: USERS_MANAGE_ENTERPRISE, USERS_MANAGE_USERS 
Request Headers: Accept: application/vnd.abiquo.publiccloudcredentialslist+json; version=4.4; application/vnd.abiquo.publiccloudcredentialslist+xml; version=4.4;  Content-type:  application/vnd.abiquo.publiccloudcredentialslist+json; version=4.4; application/vnd.abiquo.publiccloudcredentialslist+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

Request Message Body Entity:  Credentials Media Type
Response Message Body Entity: Credentials Media Type
Request Example:

 Click here to show or hide the request example

PUT_adm_ents_X_creds_X_CT_pccredss_j_AC_pccredss_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/admin/enterprises/4443/credentials/693 \ 
	 -H 'Accept:application/vnd.abiquo.publiccloudcredentials+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.publiccloudcredentials+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "access": "fa2a27b0-7c6b-44c3-ac33-225cc3136e52", 
  "key": "68acc3f9-eab5-4083-b9fe-988bb1cb313a", 
  "links": [
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/CP_TEST", 
      "rel": "hypervisortype"
    }
  ]
}

Response payload:

{
  "access": "a685cccd907c6797951d2ba0a953a914bab871e493bae72491acbdede0b40e6f56df637a295475a3a5faad126f367a92", 
  "id": 693, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/enterprises/4443", 
      "type": "application/vnd.abiquo.enterprise+json", 
      "rel": "enterprise", 
      "title": "121"
    }, 
    {
      "href": "http://localhost:9009/api/admin/enterprises/4443/credentials/693", 
      "type": "application/vnd.abiquo.publiccloudcredentials+json", 
      "rel": "edit", 
      "title": "edit public cloud credentials"
    }, 
    {
      "href": "http://localhost:9009/api/config/hypervisortypes/CP_TEST", 
      "type": "application/vnd.abiquo.hypervisortype+json", 
      "rel": "hypervisortype", 
      "title": "CP_TEST"
    }
  ]
}

Update credentials
curl --verbose -X PUT -H "Content-type: application/vnd.abiquo.publiccloudcredentials+json" -H "Accept: application/vnd.abiquo.publiccloudcredentials+json" http://examplehost/api/admin/enterprises/3/credentials -u user:pass -d @credentials.json | pjson
> PUT /api/admin/enterprises/3/credentials HTTP/1.1
> Accept: application/vnd.abiquo.publiccloudcredentialslist+json
> Content-Type: application/vnd.abiquo.publiccloudcredentials+json
> 
< HTTP/1.1 200 OK
< Content-Type: application/vnd.abiquo.publiccloudcredentials+json

{
    "access": "ZZZZZZZZZZZZZZZZZ",
    "id": 1,
    "links": [
        {
            "href": "http://examplehost/api/admin/enterprises/3",
            "rel": "enterprise",
            "title": "exampleenterprise",
            "type": "application/vnd.abiquo.enterprise+json"
        },
        {
            "href": "http://examplehost/api/admin/enterprises/3/credentials/1",
            "rel": "edit",
            "title": "edit public cloud credentials",
            "type": "application/vnd.abiquo.publiccloudcredentials+json"
        },
        {
            "href": "http://examplehost/api/config/hypervisortypes/PUBLICCLOUDPROVIDER", 
            "rel": "provider", 
            "title": "provider", 
            "type": "application/vnd.abiquo.hypervisortype+json"
        }
    ]
}

Request Body:

 Click here to show or hide the request example
Update credentials
{
 "access": "XXXXXXXXXXXXXXXXXX",
 "key": "yyyyyyyyyyyyyyyy",
 "links": [
     {
         "href": "http://examplehost/api/config/hypervisortypes/PUBLICCLOUDPROVIDER", 
         "rel": "provider"
     }
 ]
}

Errors

HTTP error codeAPI error codeMessageMethod
409 ConflictPUBLIC-4The requested provider is not supported.POST
409 ConflictPUBLIC-3The requested provider already has credentials assigned.POST
409 ConflictGEN-5

Invalid credentials

POST, GET
404 Not foundRS-2The remote service does not existPOST, GET
503 Service UnavailableVSM-7VSM service unavailable; check the URL of the service.POST, GET
404 Not foundPUBLIC-1The requested credentials do not existGET
409 ConflictPUBLIC-7The provider field of public cloud credentials can't be modified.GET