Rack Resource

Exposed Resources Hierarchy
Rack Resource

The Rack Resource offers the functionality of managing the rack infrastructure in a logical way. Feel free to distribute your machines into the Rack resource.

Rack Data Model

Field Name Type Occurs Required Description
name String 1 true The name of the rack
shortDescripton String 1 optional The description of the rack in a short form
haEnabled Boolean false optional High Availability feature is enabled for this rack
machines Link 1 false Link to the list of machines
edit Link 1 false Link to the url for editing the resource
datacenter Link 1 false Link to the rack's datacenter

Rack Data Model Enterprise version

The following fields are added in the Enterprise version:

Field Name Type Occurs Required Description
vlanIdMin Integer 1 true The minimum VLAN id
vlanIdMax Integer 1 true The maximum VLAN id
vlanPerVdcExpected Integer 1 true The Virtual LAN per Virtual Datacenter expected
nrsq Integer 1 true Networking resource security quotient
vlansIdAvoided String 1 optional The CSV list of VLAN ids to avoid

UcsRack Data Model

New Feature
This feature has been available since version 1.8
Enterprise Edition Functionality
This feature is available in Abiquo Enterprise Edition

The following fields are added in the enterprise version:

Field Name Type Occurs Required Description
ip String 1 true The IP where the UCS manager is listening
password String 1 true The password to the UCS manager
port Integer 1 true The port where the UCS manager is listening
user String 1 true The login to the UCS manager

Methods related to Rack Resource

Retrieve a list of Racks

Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/racks
Roles needed: "ROLE_PHYS_DC_RETRIEVE_DETAILS" (Check out role definitions here)

REQUEST
Request Headers: Accept.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request: .

Retrieve a list of Racks
% curl -X GET  --verbose 'http://example.com/api/admin/datacenters/1/racks' \
       -H "Accept:application/xml" \
       -u user:password

> GET /api/admin/datacenters/2/racks HTTP/1.1
> Authorization: Basic YWRtaW46eGFiaXF1bw==
> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: example.com
> Accept:application/xml
>

RESPONSE

Response Message Body: Rack.
Example Response:

Response of the GET over Racks
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTMwODY2MTU0MDUxNDoyNjM3NjhmNDJmYmNiOGRmMmM4MGZjODIwZDE0ZGE3MEFCSVFVTw; Expires=Tue, 21-Jun-2011 13:05:40 GMT; Path=/api
< Set-Cookie: JSESSIONID=C34B4AE0ADF50D4C7FB0DDE55F6EB874; Path=/api
< Content-Type: application/xml
< Content-Length: 1082
< Date: Tue, 21 Jun 2011 12:35:40 GMT
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<racks>
    <rack>
        <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
        <link href="http://example.com/api/admin/datacenters/2/racks/3" rel="edit"/>
        <link href="http://example.com/api/admin/datacenters/2/racks/3/machines" rel="machines"/>
        <haEnabled>false</haEnabled>
        <id>3</id>
        <name>api_example_rack</name>
        <nrsq>80</nrsq>
        <shortDescription>This rack is an example</shortDescription>
        <vlanIdMax>3024</vlanIdMax>
        <vlanIdMin>6</vlanIdMin>
        <vlanPerVdcExpected>6</vlanPerVdcExpected>
    </rack>
    <rack>
        <link href="http://example.com/admin/datacenters/2" rel="datacenter"/>
        <link href="http://example.com/api/admin/datacenters/2/racks/2" rel="edit"/>
        <link href="http://example.com/api/admin/datacenters/2/racks/2/machines" rel="machines"/>
        <haEnabled>false</haEnabled>
        <id>2</id>
        <longDescription></longDescription>
        <name>rac</name>
        <nrsq>80</nrsq>
        <shortDescription></shortDescription>
        <vlanIdMax>4094</vlanIdMax>
        <vlanIdMin>2</vlanIdMin>
        <vlanPerVdcExpected>1</vlanPerVdcExpected>
        <vlansIdAvoided></vlansIdAvoided>
    </rack>
</racks>
Create a new Rack

Synopsis: POST http://{$hostIp}/api/admin/datacenters/{$datacenterId}/racks
Roles needed: "ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS" (Check out role definitions here)

REQUEST
Request Headers: Accept, Content-Type.
Request Parameters: N/A.
Request Message Body: Rack.
Request example:

Create new Rack
% curl -X POST --verbose 'http://example.com/api/admin/datacenters/1/racks' \
       -H "Content-type:application/xml" \
       -H "Accept:application/xml" \
       -d @rack.xml
       -u user:password

> POST /api/admin/datacenters/2/racks HTTP/1.1
> Authorization: Basic YWRtaW46eGFiaXF1bw==
> User-Agent: curl/7.21.3 (x86_64-pc-linux-gnu) libcurl/7.21.3 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: example.com
> Content-type:application/xml
> Accept:application/xml
> Content-Length: 234
>
Download the template
You can download the template of the file @rack.xml here (click right mouse button and 'Save Link As..')

RESPONSE

Response Message Body: URI.
Response example:

The creation response
< HTTP/1.1 201 Created
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTMwODY2MTI4MzExNDphMGIzZDA0NGM0ODE0NTUyOTBmM2ExN2RmMjIyNzUyOUFCSVFVTw; Expires=Tue, 21-Jun-2011 13:01:23 GMT; Path=/api
< Location: http://example.com/api/admin/datacenters/2/racks/3
< Set-Cookie: JSESSIONID=40173810DDD3852ABD928AA695FB188D; Path=/api
< Content-Type: application/xml
< Content-Length: 545
< Date: Tue, 21 Jun 2011 12:31:23 GMT
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rack>
    <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
    <link href="http://example.com/api/admin/datacenters/2/racks/3" rel="edit"/>
    <link href="http://example.com/api/admin/datacenters/2/racks/3/machines" rel="machines"/>
    <haEnabled>false</haEnabled>
    <id>3</id>
    <name>api_example_rack</name>
    <nrsq>80</nrsq>
    <shortDescription>This rack is an example</shortDescription>
    <vlanIdMax>3024</vlanIdMax>
    <vlanIdMin>6</vlanIdMin>
    <vlanPerVdcExpected>6</vlanPerVdcExpected>
</rack>

Create a new UcsRack
New Feature
This feature has been available since version 1.8
Enterprise Edition Functionality
This feature is available in Abiquo Enterprise Edition

When creating a UcsRack we discover the blades (Physical Machines) configured within the UCS. If the data provided for the connection is invalid, a UcsRack will be inserted into Abiquo but with no Physical Machines attached to it.

Synopsis: POST http://{$hostIp}/api/admin/datacenters/{$datacenterId}/racks
Roles needed: "ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS" (Check out role definitions here)

REQUEST
Request Headers: Accept, Content-Type.
Request Parameters: N/A.
Request Message Body: UcsRack.
Request example:

Create new UcsRack
% curl  -X POST --verbose 'http://example.com/api/admin/datacenters/1/racks' \
       -H "Content-type:application/managedrackdto+xml" \
       -H "Accept:application/managedrackdto+xml" \
       -d @ucsrack.xml \
       -u user:password

> POST /api/admin/datacenters/1/rack HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Content-type:application/managedrackdto+xml
> Accept:application/managedrackdto+xml
<ucsrack>
   <id>2</id>
    <name>rack 2</name>
    <shortDescription>the new ucsRack 2</shortDescription>
    <vlanIdMin>2</vlanIdMin>
    <vlanIdMax>1002</vlanIdMax>
    <vlanPerVdcExpected>2</vlanPerVdcExpected>
    <nrsq>10</nrsq>
    <haEnabled>false</haEnabled>
    <ip>0.0.0.0</ip>
    <password>password</password>
    <port>80</port>
    <user>user</user>
</ucsrack>
Download the template
You can download the template of the file @ucsrack.xml here (click right mouse button and 'Save Link As..')

RESPONSE

Response Message Body: UcsRack.
Response example:

The UcsRack creation response
< HTTP/1.1 201 Created
< Content-Type: application/managedrackdto+xml
< Location: http://example.com/api/datacenters/1/racks/2
<
<ucsrack>
    <id>2</id>
    <name>rack 2</name>
    <shortDescription>the new ucsRack 2</shortDescription>
    <vlanIdMin>2</vlanIdMin>
    <vlanIdMax>1002</vlanIdMax>
    <vlanPerVdcExpected>2</vlanPerVdcExpected>
    <nrsq>10</nrsq>
    <haEnabled>false</haEnabled>
    <ip>0.0.0.0</ip>
    <password>password</password>
    <port>80</port>
    <user>user</user>
    <link rel="edit" href="http://example.com/api/datacenters/1/racks/2"/>
    <link rel="machines" href="http://example.com/api/datacenters/1/racks/2/machines"/>
    <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
</ucsrack>
Retrieve a Rack

Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/racks/{$rackId}
Roles needed: "ROLE_PHYS_DC_RETRIEVE_DETAILS" (Check out role definitions here)

REQUEST
Request Headers: Accept.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request: Retrieve information about a Rack.

GET Rack Request
% curl -X GET --verbose 'http://example.com/api/admin/datacenters/1/racks/2' \
        -H "Accept:application/xml"  \
        -u user:password

> GET /api/admin/datacenters/1/racks/2 HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Content-type:application/xml
> Accept:application/xml

RESPONSE
Response Headers: Content-Length, Content-Type.
Response Message Body: Rack.
Response Status: 200, 401, 403.
Example Response:

GResponse of the GET over a Rack
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTMwODY2NzYyMzkyMzpmMTRkOTBmNDUzMjcxYTk2YmE1ZDY4MjZjOWJkZWU2NEFCSVFVTw; Expires=Tue, 21-Jun-2011 14:47:03 GMT; Path=/api
< Set-Cookie: JSESSIONID=D2EFEBE23F7B044F9FA97131128CC6EA; Path=/api
< Content-Type: application/xml
< Content-Length: 545
< Date: Tue, 21 Jun 2011 14:17:03 GMT
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rack>
    <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
    <link href="http://example.com/api/admin/datacenters/2/racks/3" rel="edit"/>
    <link href="http://example.com/api/admin/datacenters/2/racks/3/machines" rel="machines"/>
    <haEnabled>false</haEnabled>
    <id>3</id>
    <name>api_example_rack</name>
    <nrsq>80</nrsq>
    <shortDescription>This rack is an example</shortDescription>
    <vlanIdMax>3024</vlanIdMax>
    <vlanIdMin>6</vlanIdMin>
    <vlanPerVdcExpected>6</vlanPerVdcExpected>
</rack>
Update an existing Rack

Synopsis: PUT http://example.com/api/admin/datacenters/{$datacenterId}/racks/{$idRack}
Roles needed: "ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS" (Check out role definitions here)

REQUEST
Request Headers: Accept, Content-Type
Request Parameters: N/A.
Request Message Body: Rack.
Example Request:

Update Rack entity.
% curl -X PUT --verbose 'http://example.com/api/admin/datacenters/1/racks/2' \
        -H "Content-type:application/xml" \
        -H "Accept:applcation/xml" \
        -d @rack.xml \
        -u user:password

> PUT /api/admin/datacenters/1/racks/2 HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Content-type:application/xml
> Accept:application/xml
Use your downloaded template
You can use the template of the file @rack_update.xml (click right mouse button and 'Save Link As..') and modify its parameters to perform the Update, since the message body is the same as the creation one, but supplying the correct <id> tag

RESPONSE
Response Message Body: Rack.

PUT Rack Response
< HTTP/1.1 200 OK
< Content-Type: application/xml
< Content-Length: 0
<
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Set-Cookie: auth=YWRtaW46MTMwODY2Nzk3ODAxNDpmNDI3NzFjNmI3Y2Q1NWJmYWY1MzNhNTZlNmUwOThhNUFCSVFVTw; Expires=Tue, 21-Jun-2011 14:52:58 GMT; Path=/api
< Set-Cookie: JSESSIONID=A27CACA472C17F2B0FA92DB968989D59; Path=/api
< Content-Type: application/xml
< Content-Length: 545
< Date: Tue, 21 Jun 2011 14:22:58 GMT
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rack>
    <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
    <link href="http://example.com/api/admin/datacenters/2/racks/3" rel="edit"/>
    <link href="http://example.com/api/admin/datacenters/2/racks/3/machines" rel="machines"/>
    <haEnabled>false</haEnabled>
    <id>3</id>
    <name>api_rack_updated</name>
    <nrsq>80</nrsq>
    <shortDescription>This rack is an example</shortDescription>
    <vlanIdMax>3024</vlanIdMax>
    <vlanIdMin>6</vlanIdMin>
    <vlanPerVdcExpected>6</vlanPerVdcExpected>
</rack>

Update an existing UcsRack
New Feature
This feature has been available since version 1.8
Enterprise Edition Functionality
This feature is available in Abiquo Enterprise Edition

The IP datamember cannot be updated. So the Abiquo API will just ignore the data. Even if you perform a PUT with a modified IP, the Abiquo API will return the modified UcsRack info with the old IP. In other words changing the IP in a UcsRack is not supported.

Synopsis: PUT http://example.com/api/admin/datacenters/{$datacenterId}/racks/{$idRack}
Roles needed: "ROLE_PHYS_DC_ALLOW_MODIFY_SERVERS" (Check out role definitions here)

REQUEST
Request Headers: Accept, Content-Type
Request Parameters: N/A.
Request Message Body: UcsRack.
Example Request:

Update UcsRack entity.
% curl --verbose 'http://example.com/api/admin/datacenters/1/racks/2' \
        -X "PUT" \
        -H "Content-type:application/managedrackdto+xml" \
        -H "Accept:application/managedrackdto+xml" \
        -u user:password \
        -d '<ucsrack>
                <id>2</id>
                <name>useless rack</name>
                <shortDescription>this rack is useless</shortDescription>
                <vlanIdMin>3</vlanIdMin>
                <vlanIdMax>1003</vlanIdMax>
                <vlanPerVdcExpected>3</vlanPerVdcExpected>
                <nrsq>20</nrsq>
                <haEnabled>false</haEnabled>
                <ip>0.0.0.0</ip>
                <password>password</password>
                <port>80</port>
                <user>user</user>
            </ucsrack>'

> PUT /api/admin/datacenters/1/racks/2 HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Content-type:application/managedrackdto+xml
> Accept:application/managedrackdto+xml
<ucsrack>
    <id>2</id>
    <name>useless rack</name>
    <shortDescription>this rack is useless</shortDescription>
    <vlanIdMin>3</vlanIdMin>
    <vlanIdMax>1003</vlanIdMax>
    <vlanPerVdcExpected>3</vlanPerVdcExpected>
    <nrsq>20</nrsq>
    <haEnabled>false</haEnabled>
    <ip>0.0.0.0</ip>
    <password>password</password>
    <port>80</port>
    <user>user</user>
    <link rel="edit" href="http://example.com/api/datacenters/1/racks/2"/>
    <link rel="machines" href="http://example.com/api/datacenters/1/racks/2/machines"/>
    <link href="http://example.com/admin/datacenters/2" rel="datacenter"/>
</ucsrack>

RESPONSE

Response Message Body: N/A.

PUT UcsRack Response
< HTTP/1.1 204 NO CONTENT
< Content-Type: application/xml
< Content-Length: 0
<
Retrieve the list of UcsRacks
New Feature
This feature has been available since version 1.8
Enterprise Edition Functionality
This feature is available in Abiquo Enterprise Edition

Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/racks/
Roles needed: "ROLE_PHYS_DC_RETRIEVE_DETAILS" (Check out role definitions here)

REQUEST
Request Headers: Accept.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request:

Retrieve the list of UcsRacks.
% curl --verbose 'http://example.com/api/admin/datacenters/1/racks/' \
        -X GET \
        -H "Accept:application/managedrackdto+xml" \
        -u user:password

> GET /api/admin/datacenters/1/racks/2 HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Content-type:application/xml
> Accept:application/managedrackdto+xml

RESPONSE

Response Message Body: List of UcsRack.
Example Response:

Response of the GET over a UCSRack
< HTTP/1.1 200 OK
< Content-Type: application/managedrackdto+xml
<
<ucsracks>
    <ucsrack>
        <link rel="edit" href="http://example.com/api/datacenters/1/racks/2"/>
        <link rel="machines" href="http://example.com/api/datacenters/1/racks/2/machines"/>
        <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
        <id>2</id>
        <name>rack 2</name>
        <shortDescription>the new rack 2</shortDescription>
        <vlanIdMin>2</vlanIdMin>
        <vlanIdMax>1002</vlanIdMax>
        <vlanPerVdcExpected>2</vlanPerVdcExpected>
        <nrsq>10</nrsq>
        <haEnabled>false</haEnabled>
        <ip>0.0.0.0</ip>
        <password>password</password>
        <port>80</port>
        <user>user</user>
    </ucsrack>
</ucsracks>

Retrieve a UcsRack
New Feature
This feature has been available since version 1.8
Enterprise Edition Functionality
This feature is available in Abiquo Enterprise Edition

Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/racks/{$rackId}
Roles needed: "ROLE_PHYS_DC_RETRIEVE_DETAILS" (Check out role definitions here)

REQUEST
Request Headers: Accept("application/managedrackdto+xml"), Content-type("application/managedrackdto+xml")
Request Parameters: N/A.
Request Message Body: N/A.
Example Request: Retrieve information about a Rack.

GET Rack Request
% curl --verbose 'http://example.com/api/admin/datacenters/1/racks/2' \
        -X GET \
        -H "Content-type:application/managedrackdto+xml" \
        -H "Accept:application/managedrackdto+xml" \
        -u user:password

> GET /api/admin/datacenters/1/racks/2 HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Content-type:application/xml
> Accept:application/managedrackdto+xml

RESPONSE

Response Message Body: UcsRack.
Example Response: Response of the GET over a Rack

GET UcsRack Response
< HTTP/1.1 200 OK
< Content-Type: application/managedrackdto+xml
<
<ucsrack>
    <link rel="edit" href="http://example.com/api/datacenters/1/racks/2"/>
    <link rel="machines" href="http://example.com/api/datacenters/1/racks/2/machines"/>
    <link href="http://example.com/api/admin/datacenters/2" rel="datacenter"/>
    <id>2</id>
    <name>rack 2</name>
    <shortDescription>the new rack 2</shortDescription>
    <vlanIdMin>2</vlanIdMin>
    <vlanIdMax>1002</vlanIdMax>
    <vlanPerVdcExpected>2</vlanPerVdcExpected>
    <nrsq>10</nrsq>
    <haEnabled>false</haEnabled>
    <ip>0.0.0.0</ip>
    <password>password</password>
    <port>80</port>
    <user>user</user>
</ucsrack>

Retrieve a list of Not Managed Racks
New Feature
This feature has been available since version 1.8
Enterprise Edition Functionality
This feature is available in Abiquo Enterprise Edition

Retrieve the list of all Racks in Abiquo that are not managed and are associated with the Datacenter (ordinary racks). While the Retrieve a list of racks method returns all the racks (managed or not) in the media type Rack, even if they are UcsRacks, this method returns only the NON-UCS racks.

Synopsis: GET http://example.com/api/admin/datacenters/{$datacenterId}/racks
Roles needed: "ROLE_PHYS_DC_RETRIEVE_DETAILS" (Check out role definitions here)

REQUEST
Request Headers: Accept, Content-Type.
Request Parameters: N/A.
Request Message Body: N/A.
Example Request: Retrieve a list of Racks.

GET Racks Request
% curl --verbose 'http://example.com/api/admin/datacenters/1/racks' \
        -X GET \
        -H "Accept:application/notmanagedrackdto+xml" \
        -u user:password

> GET /api/admin/datacenters/1/racks HTTP/1.1
> User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
> Host: example.com
> Accept:application/notmanagedrackdto+xml

RESPONSE

Response Message Body: Rack.
Example Response:

Response of the GET over Racks
< HTTP/1.1 200 OK
< Content-Type: application/notmanagedrackdto+xml
<
<racks>
    <rack>
      <link href="http://example.com/api/admin/datacenters/1" rel="datacenter"/>
      <link href="http://example.com/api/admin/datacenters/1/racks/2" rel="edit"/>
      <link href="http://v/api/admin/datacenters/1/racks/2/machines" rel="machines"/>
      <id>2</id>
      <name>rack 2</name>
      <shortDescription>the new rack 2</shortDescription>
      <vlanIdMin>2</vlanIdMin>
      <vlanIdMax>1002</vlanIdMax>
      <vlanPerVdcExpected>2</vlanPerVdcExpected>
      <nrsq>10</nrsq>
      <haEnabled>false</haEnabled>
    </rack>
</racks>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.