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:

Scope Resource

The Scopes Resource represents the scopes available in the platform. An administration scope is used to allow access to a set of enterprises and datacenters. A scope can be assigned to a user or a resource, such as a template or spec. 

Main URI of the Resource

This class operates mainly over the Resource URI: /admin/scopes

Exposed Methods

List scopes

Return the list of scopes available to associate with roles.

Paging Method

This method works with paging. Check out Basic Behaviors for information about how it works

Synopsis: GET http://example.com/api/admin/scopes
Roles Required: USERS_VIEW_PRIVILEGES,USERS_MANAGE_SCOPES, USERS_MANAGE_USERS, APPLIB_ALLOW_MODIFY, MANAGE_VAPP_SPEC
Request Headers: Accept: application/vnd.abiquo.scopes+json; version=4.4; application/vnd.abiquo.scopes+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

has

false

 

filter the request by name

asc

false

true

ascending or descending order

by

false

name

order the request by this parameter. Valid value is {NAME}

limit

false

25

number of elements to return

startwith

false

0

first element to retrieve

 

 

 

 

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

 Click here to show or hide the request example

GET_adm_scps_AC_scps_j.0001.txt

cURL:

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

Success status code: 200

Request payload:

--none--

Response payload:

{
  "totalSize": 8, 
  "links": [], 
  "collection": [
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/796", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "0165"
        }
      ], 
      "id": 796, 
      "name": "0165"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/797", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "0166"
        }, 
        {
          "href": "http://localhost:9009/api/admin/scopes/796", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scopeParent", 
          "title": "0165"
        }
      ], 
      "id": 797, 
      "name": "0166"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/798", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "0167"
        }, 
        {
          "href": "http://localhost:9009/api/admin/scopes/797", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scopeParent", 
          "title": "0166"
        }
      ], 
      "id": 798, 
      "name": "0167"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/799", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "0168"
        }, 
        {
          "href": "http://localhost:9009/api/admin/scopes/797", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scopeParent", 
          "title": "0166"
        }
      ], 
      "id": 799, 
      "name": "0168"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/800", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "0169"
        }
      ], 
      "id": 800, 
      "name": "0169"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/801", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "0170"
        }
      ], 
      "id": 801, 
      "name": "0170"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": true, 
      "automaticAddEnterprise": true, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/794", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "Global scope"
        }
      ], 
      "id": 794, 
      "name": "Global scope"
    }, 
    {
      "scopeEntities": [], 
      "automaticAddDatacenter": false, 
      "automaticAddEnterprise": false, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/795", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "edit", 
          "title": "scpX"
        }
      ], 
      "id": 795, 
      "name": "scpX"
    }
  ]
}

Create a scope

Create a scope.

Synopsis: POST http://example.com/api/admin/scopes
Roles Required: USERS_MANAGE_SCOPES
Request Headers: Accept: application/vnd.abiquo.scope+json; version=4.4; application/vnd.abiquo.scope+xml; version=4.4;  Content-type:  application/vnd.abiquo.scope+json; version=4.4; application/vnd.abiquo.scope+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

POST_adm_scps_CT_scp_j_AC_scp_j.0001.txt

cURL:

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

Success status code: 201

Request payload:

{
  "scopeEntities": [
    {
      "type": "ENTERPRISE", 
      "idResource": 1152, 
      "links": []
    }, 
    {
      "type": "DATACENTER", 
      "idResource": 878, 
      "links": []
    }, 
    {
      "type": "DATACENTER", 
      "idResource": 879, 
      "links": []
    }
  ], 
  "automaticAddDatacenter": false, 
  "automaticAddEnterprise": false, 
  "links": [], 
  "name": "scope-1"
}

Response payload:

{
  "scopeEntities": [
    {
      "type": "ENTERPRISE", 
      "id": 2245, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/767", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scope", 
          "title": "scope-1"
        }
      ], 
      "idResource": 1152
    }, 
    {
      "type": "DATACENTER", 
      "id": 2246, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/767", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scope", 
          "title": "scope-1"
        }
      ], 
      "idResource": 878
    }, 
    {
      "type": "DATACENTER", 
      "id": 2247, 
      "links": [
        {
          "href": "http://localhost:9009/api/admin/scopes/767", 
          "type": "application/vnd.abiquo.scope+json", 
          "rel": "scope", 
          "title": "scope-1"
        }
      ], 
      "idResource": 879
    }
  ], 
  "automaticAddDatacenter": false, 
  "automaticAddEnterprise": false, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/scopes/767", 
      "type": "application/vnd.abiquo.scope+json", 
      "rel": "edit", 
      "title": "scope-1"
    }
  ], 
  "id": 767, 
  "name": "scope-1"
}

 

Get a scope

Retrieve a single scope.

Synopsis: GET http://example.com/api/admin/scopes/{scope}
Roles Required: USERS_VIEW_PRIVILEGES,USERS_MANAGE_SCOPES, USERS_MANAGE_USERS
Request Headers: Accept: application/vnd.abiquo.scope+json; version=4.4; application/vnd.abiquo.scope+xml; version=4.4;  Content-type: ;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

GET_adm_scps_X_AC_scp_j.0001.txt

cURL:

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

Success status code: 200

Request payload:

--none--

Response payload:

{
  "scopeEntities": [], 
  "automaticAddDatacenter": true, 
  "automaticAddEnterprise": true, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/scopes/424", 
      "type": "application/vnd.abiquo.scope+json", 
      "rel": "edit", 
      "title": "Global scope"
    }
  ], 
  "id": 424, 
  "name": "Global scope"
}

Delete a scope

Delete a scope.

Synopsis: DELETE http://example.com/api/admin/scopes/{scope}
Roles Required: USERS_MANAGE_SCOPES
Request Headers: Accept: ; Content-type: ;
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_scps_X_CT_scp_j.0001.txt

cURL:

curl -X DELETE http://localhost:9000/api/admin/scopes/1498 \ 
	 -H 'Accept:application/vnd.abiquo.scope+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.scope+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 204

Request payload:

--none--

Response payload:

--none--

Update a scope

Update a single scope.

Synopsis: PUT http://example.com/api/admin/scopes/{scope}
Roles Required: USERS_MANAGE_SCOPES
Request Headers: Accept: application/vnd.abiquo.scope+json; version=4.4; application/vnd.abiquo.scope+xml; version=4.4;  Content-type:  application/vnd.abiquo.scope+json; version=4.4; application/vnd.abiquo.scope+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

 

 

 

 

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

 Click here to show or hide the request example

PUT_adm_scps_X_CT_scp_j_AC_scp_j.0001.txt

cURL:

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

Success status code: 200

Request payload:

{
  "scopeEntities": [], 
  "automaticAddDatacenter": false, 
  "automaticAddEnterprise": false, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/scopes/5629", 
      "type": "application/vnd.abiquo.scope+json", 
      "rel": "edit", 
      "title": "0014"
    }
  ], 
  "id": 5629, 
  "name": "0014"
}

Response payload:

{
  "scopeEntities": [], 
  "automaticAddDatacenter": false, 
  "automaticAddEnterprise": false, 
  "links": [
    {
      "href": "http://localhost:9009/api/admin/scopes/5629", 
      "type": "application/vnd.abiquo.scope+json", 
      "rel": "edit", 
      "title": "0014"
    }
  ], 
  "id": 5629, 
  "name": "0014"
}