Console Developer Guide
Red Hat Gluster Storage Console Developer Guide
Abstract
Part I. Introduction Copy linkLink copied to clipboard!
Chapter 1. Introduction Copy linkLink copied to clipboard!
- Broad client support - Any programming language, framework, or system with support for HTTP protocol can use the API;
- Self descriptive - Client applications require minimal knowledge of the storage infrastructure as many details are discovered at runtime;
- Resource-based model - The resource-based REST model provides a natural way to manage a storage platform.
- Integrate with enterprise IT systems.
- Integrate with third-party software.
- Perform automated maintenance or error checking tasks.
- Automate repetitive tasks in a Red Hat Gluster Storage environment with scripts.
1.1. Representational State Transfer Copy linkLink copied to clipboard!
GET, POST, PUT, and DELETE. This provides a stateless communication between the client and server where each request acts independent of any other request and contains all necessary information to complete the request.
1.2. Prerequisites Copy linkLink copied to clipboard!
- An installation of Red Hat Gluster Storage Console, which includes the REST API;
- A client or programming library that initiates and receives HTTP requests from the REST API. As an example, this guide includes basic instructions on use with cURL in Appendix B, API Usage with cURL;
- Knowledge of Hypertext Transfer Protocol (HTTP), which is the protocol used for REST API interactions. The Internet Engineering Task Force provides a Request for Comments (RFC) explaining the Hypertext Transfer Protocol at http://www.ietf.org/rfc/rfc2616.txt; and,
- Knowledge of Extensible Markup Language (XML), which the API uses to construct resource representations. The W3C provides a full specification on XML at http://www.w3.org/TR/xml/.
Chapter 2. Authentication and Security Copy linkLink copied to clipboard!
2.1. TLS/SSL Certification Copy linkLink copied to clipboard!
Procedure 2.1. Attain a certificate
- Method 1 - Use a command line tool to download the certificate from the server. Examples of command line tools include cURL and Wget; both are available for multiple platforms.
- If using cURL:
curl -o rhsc.cer http://[rhgsc-server]/ca.crt
curl -o rhsc.cer http://[rhgsc-server]/ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If using Wget:
wget -O rhsc.cer http://[rhgsc-server]/ca.crt
wget -O rhsc.cer http://[rhgsc-server]/ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- Method 2 - Use a web browser to navigate to the certificate located at:Depending on the chosen browser, the certificate either downloads or imports into the browser's keystore.
http://[rhgsc-server]/ca.crt
http://[rhgsc-server]/ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If the browser downloads the certificate: save the file as
rhsc.cer.If the browser imports the certificate: export it from the browser's certification options and save it asrhsc.cer.
rhsc.cer on your client machine. An API user imports this file into the client's certificate store.
Procedure 2.2. Import a certificate to your client
- A certificate import for your client relies on how the client itself stores and interprets certificates. This guide contains an example on importing to a Java keystore in Appendix D, Java Keystores. For clients not using Network Security Services (NSS) or Java KeyStore (JKS), please refer to your client documentation for more information on importing a certificate.
2.2. HTTP Authentication Copy linkLink copied to clipboard!
Authorization header, the API sends a 401 Authorization Required as a result:
Example 2.1. Access to the REST API without appropriate credentials
HEAD [base] HTTP/1.1 Host: [host] HTTP/1.1 401 Authorization Required
HEAD [base] HTTP/1.1
Host: [host]
HTTP/1.1 401 Authorization Required
Authorization header for the specified realm. An API user encodes an appropriate Red Hat Gluster Storage Console domain and user in the supplied credentials with the username@domain:password convention.
| Item | Value |
|---|---|
| username | rhscadmin |
| domain | domain.example.com |
| password | 123456 |
| unencoded credentials | rhscadmin@domain.example.com:123456 |
| base64 encoded credentials | cmhzY2FkbWluQGRvbWFpbi5leGFtcGxlLmNvbToxMjM0NTYK |
Example 2.2. Access to the REST API with appropriate credentials
Important
Important
2.3. Authentication Sessions Copy linkLink copied to clipboard!
- Send a request with the
AuthorizationandPrefer:persistent-auth.Copy to Clipboard Copied! Toggle word wrap Toggle overflow This returns a response with the following header:Set-Cookie: JSESSIONID=5dQja5ubr4yvI2MM2z+LZxrK; Path=/api; Secure
Set-Cookie: JSESSIONID=5dQja5ubr4yvI2MM2z+LZxrK; Path=/api; SecureCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note theJSESSIONID=value. In this example the value isJSESSIONID=5dQja5ubr4yvI2MM2z+LZxrK. - Send all subsequent requests with the
Prefer:persistent-authand cookie header with theJSESSIONID=value. TheAuthorizationis no longer needed when using an authenticated session.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - When the session is no longer required, perform a request to the sever without the
Prefer: persistent-authheader.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 3. REST API Quick Start Examples Copy linkLink copied to clipboard!
Important
Host: and Authorization: fields. However, these fields are mandatory and require data specific to your installation of Red Hat Gluster Storage Console.
Important
USER:PASS) and certificate location (CERT). Ensure all requests performed with cURL fulfil certification and authentication requirements. See Chapter 2, Authentication and Security and Appendix B, API Usage with cURL for more information.
Note
id attribute for each resource. Identifier codes in this example might appear different to the identifier codes in your Red Hat Gluster Storage Console environment.
3.1. Example: Access API Entry Point Copy linkLink copied to clipboard!
Example 3.1. Access the API entry point
GET /api HTTP/1.1 Accept: application/xml
GET /api HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api
rel= attribute of each collection link provides a reference point for each link. The next step in this example examines the cluster collection, which is available through the rel="cluster" link.
product_info and summary. This data is covered in chapters outside this example.
3.2. Example: List Cluster Collection Copy linkLink copied to clipboard!
Default cluster on installation. This example uses the Default cluster to group resources in your Red Hat Gluster Storage environment.
Example 3.2. List clusters collection
GET /api/clusters HTTP/1.1 Accept: application/xml
GET /api/clusters HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/clusters
id code of your Default cluster. This code identifies this cluster in relation to other resources of your storage environment.
3.3. Example: List Host Collection Copy linkLink copied to clipboard!
host1 registered with the default cluster.
Example 3.3. List hosts collection
GET /api/hosts HTTP/1.1 Accept: application/xml
GET /api/hosts HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/hosts
id code of your Default server. This code identifies this host in relation to other resources of your virtual environment.
3.4. Example: Add Host to Cluster Copy linkLink copied to clipboard!
Example 3.4. Add Server to Cluster
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/hosts -d "<host><cluster id=\"99408929-82cf-4dc7-a532-9d998063fa95\"/><name>host1</name><address>IP_ADDRESS</address><root_password>ROOT_PASSWORD</root_password></host>"
3.5. Example: Create Volume Copy linkLink copied to clipboard!
data, volume type DISTRIBUTE, and having two bricks in the default cluster.
Example 3.5. Creating a Volume
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes -d "<gluster_volume><name>data</name><volume_type>DISTRIBUTE</volume_type><bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick1</brick_dir></brick><brick><server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id><brick_dir>/export/data/brick2</brick_dir></brick></bricks></gluster_volume>"
3.6. Example: List Volume Collection Copy linkLink copied to clipboard!
Default cluster.
Example 3.6. List Volume Collection
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes HTTP/1.1 Accept: application/xml
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] https://[RHGSC Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes
3.7. Example: Start Volume Copy linkLink copied to clipboard!
Example 3.7. Start Volume
POST api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/start HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/start HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/start -d "<action/>"
3.8. Example: List Brick Collection Copy linkLink copied to clipboard!
Example 3.8. List Brick Collection
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks HTTP/1.1 Accept: application/xml
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks
3.9. Example: Add Bricks to Volume Copy linkLink copied to clipboard!
Example 3.9. Add Bricks to Volume
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks -d "<bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick3</brick_dir></brick></bricks>"
3.10. Example: Check System Events Copy linkLink copied to clipboard!
login action for admin creates entries in the events collection. This example lists the events collection and identifies events specific to log in of the admin.
Example 3.10. List the events collection
GET /api/events HTTP/1.1 Accept: application/xml
GET /api/events HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/events
id="54"- The API authenticates with theadminuser's username and password.id="192"- The API, acting as theadminuser, startsVolume Dataon theDefaultclusterid="193"- The API logs out of theadminuser account.
Chapter 4. Python Quick Start Example Copy linkLink copied to clipboard!
4.1. Python Quick Start Introduction Copy linkLink copied to clipboard!
ovirtsdk Python library provided by the rhsc-sdk package. This package is available to systems subscribed to a Red Hat Gluster Storage pool if you use the certificate-based Red Hat Network, or the Red Hat Gluster Storage channel if you use the Red Hat Network classic. See the Red Hat Gluster Storage Console Installation Guide for more information on subscribing systems to download software from these locations.
Note
- A networked installation of Red Hat Gluster Storage Console.
- A networked and configured Red Hat Gluster Storage Server.
- A working understanding of both the logical and physical objects that make up a Red Hat Gluster Storage environment.
- A working understanding of the Python programming language.
Important
Note
Note
ovirtsdk.infrastructure.errors module.
4.2. Example: Accessing the API Entry Point using Python Copy linkLink copied to clipboard!
ovirtsdk Python library provides the API class, which acts as the entry point for the API.
Example 4.1. Accessing the API entry point using Python
API class. If connection is established successfully, a message is printed. Lastly, the disconnect() method of the API class is called to close the connection.
- The
urlof the Console with which to connect. - The
usernameof the user to authenticate. - The
passwordof the user to authenticate. - The
ca_filethat is the path to a certificate. The certificate is expected to be a copy of the Console's Certificate Authority. It can be obtained fromhttps://[HOST]/ca.crt.
API class supports other parameters. Only mandatory parameters are specified in this example.
Connected to Red Hat Gluster Storage Console successfully!
Connected to Red Hat Gluster Storage Console successfully!
Example 4.2. Listing the Cluster Collection using Python
API class provides a cluster collection named default cluster. This collection contains all the clusters in the environment.
Default cluster exists, the example outputs:
Default (99408929-82cf-4dc7-a532-9d998063fa95)
Default (99408929-82cf-4dc7-a532-9d998063fa95)
Example 4.3. Listing the Networks Collection using Python
API class provides access to a networks collection named Management Networks. This collection contains all the networks in the environment.
networks collection. It also outputs some basic information about each network in the collection.
Management Network 00000000-0000-0000-0000-000000000009 ovirtmgmt
Management Network
00000000-0000-0000-0000-000000000009
ovirtmgmt
Example 4.4. Listing the Host Collection using Python
API class provides access to a host collection. This collection contains all the hosts in the storage cluster.
host name: 10.70.37.49 (host ID: 5be18d62-e7b0-4407-8ff6-68290a92338f) host name: 10.70.37.50 (host ID: 3b202041-6e14-43df-a844-92a141bed1ed)
host name: 10.70.37.49 (host ID: 5be18d62-e7b0-4407-8ff6-68290a92338f)
host name: 10.70.37.50 (host ID: 3b202041-6e14-43df-a844-92a141bed1ed)
Example 4.5. Listing the Volume Collection using Python
Example 4.6. Listing the Brick Collection from a Volume using Python
getGlusterVolumeBrickDetails()lists the bricks of the volume that is assigned to the cluster.
Example 4.7. Listing hooks in a Red Hat Gluster Storage Console
getHookList(clusterName) lists the Gluster hooks created in the Console.
Part II. REST Application Programming Interface Copy linkLink copied to clipboard!
Chapter 5. Entry Point Copy linkLink copied to clipboard!
GET request on the entry point URI consisting of a host and base.
Example 5.1. Accessing the API Entry Point
www.example.com and the base is /api, the entry point appears with the following request:
Note
Host: and Authorization: request headers and assume the base is the default /api path. This base path differs depending on your implementation.
5.1. Product Information Copy linkLink copied to clipboard!
product_info element to help an API user determine the legitimacy of the Red Hat Gluster Storage environment. This includes the name of the product, the vendor and the version.
Example 5.2. Verify a genuine Red Hat Gluster Storage environment
5.2. Link elements Copy linkLink copied to clipboard!
link elements and URIs for all of the resource collections the API exposes. Each collection uses a relation type to identify the URI a client needs.
| Relationship | Description |
|---|---|
capabilities | Supported capabilities of the Red Hat Gluster Storage Console. |
clusters | Clusters. |
events | Events. |
hosts | Hosts. |
networks | Virtual networks. |
roles | Roles. |
tags | Tags. |
users | Users. |
groups | Imported identity service groups. |
domains | Identity service domains. |
link elements also contain a set of search URIs for certain collections. These URIs use URI templates [2] to integrate search queries. The purpose of the URI template is to accept a search expression using the natural HTTP pattern of a query parameter. The client does not require prior knowledge of the URI structure. Thus clients should treat these templates as being opaque and access them with a URI template library.
"collection/search".
| Relationship | Description |
|---|---|
clusters/search | Query clusters. |
events/search | Query events. |
hosts/search | Query hosts. |
users/search | Query users. |
groups/search | Query groups. |
5.3. Summary element Copy linkLink copied to clipboard!
| Element | Description |
|---|---|
hosts | Total number of hosts and total number of active hosts. |
users | Total number of users and total number of active users. |
5.4. RESTful Service Description Language (RSDL) Copy linkLink copied to clipboard!
GET /api?rsdl HTTP/1.1 Accept: application/xml
GET /api?rsdl HTTP/1.1
Accept: application/xml
| Element | Description |
|---|---|
| description | A plain text description of the RSDL document. |
| version | The API version, including major release, minor release, build and revision. |
| schema | A link to the XML schema (XSD) file. . |
| links | Defines each link in the API. |
| Element | Description |
|---|---|
link | A URI for API requests. Includes a URI attribute (href) and a relationship type attribute (rel). |
request | Defines the request properties required for the link. |
http_method | The method type to access this link. Includes the standard HTTP methods for REST API access: GET, POST, PUT and DELETE. |
headers | Defines the headers for the HTTP request. Contains a series of header elements, which each contain a header name and value to define the header. |
body | Defines the body for the HTTP request. Contains a resource type and a parameter_set, which contains a sets of parameter elements with attributes to define whether they are required for a request and the data type. The parameter element also includes a name element to define the Red Hat Gluster Storage Console property to modify and also a further parameter_set subset if type is set to collection. |
response | Defines the output for the HTTP request. Contains a type element to define the resource structure to output. |
Chapter 6. Capabilities Copy linkLink copied to clipboard!
rel="capabilities" link obtained from the entry point URI.
6.1. Version-Dependent Capabilities Copy linkLink copied to clipboard!
version contains a series of capabilities dependent on the version specified.
6.2. Current Version Copy linkLink copied to clipboard!
true or false.
6.3. Red Hat Gluster Storage Volume Types Copy linkLink copied to clipboard!
gluster_volume_types element lists the available type of Red Hat Gluster Storage volumes.
6.4. Red Hat Gluster Storage Transport Types Copy linkLink copied to clipboard!
transport_types element lists the available transport types for Red Hat Gluster Storage volumes.
6.5. Step Type Copy linkLink copied to clipboard!
step_type element lists the available type of job steps while monitoring a jobs on Red Hat Gluster Storage volumes.
6.6. Gluster Hook Content Type Copy linkLink copied to clipboard!
content_type element lists the Gluster Hook content types.
<content_types>
<content_type>text</content_type>
<content_type>binary</content_type>
</content_types>
<content_types>
<content_type>text</content_type>
<content_type>binary</content_type>
</content_types>
6.7. Gluster Hook Stage Copy linkLink copied to clipboard!
hook_states element lists the available status of the hooks.
<hook_states>
<hook_state>enabled</hook_state>
<hook_state>disabled</hook_state>
<hook_state>missing</hook_state>
</hook_states>
<hook_states>
<hook_state>enabled</hook_state>
<hook_state>disabled</hook_state>
<hook_state>missing</hook_state>
</hook_states>
6.8. Resource Status States Copy linkLink copied to clipboard!
creation_states, host_states, host_non_operational_details, gluster_volume_states, and brick_states.
Chapter 7. Common Features Copy linkLink copied to clipboard!
Note
| Property | Description | Icon |
|---|---|---|
| Required for creation | These elements must be included in the client-provided representation of a resource on creation, but are not mandatory for an update of a resource. |
|
| Non-updateable | These elements cannot have their value changed when updating a resource. Include these elements in a client-provided representation on update only if their values are not altered by the API user. If altered, the API reports an error. |
|
| Read-only | These elements are read-only. Values for read-only elements are not created or modified. |
|
7.1. Representations Copy linkLink copied to clipboard!
<resource id="resource_id" href="/api/collection/resource_id">
<name>Resource-Name</name>
...
</resource>
<resource id="resource_id" href="/api/collection/resource_id">
<name>Resource-Name</name>
...
</resource>
<gluster_volume href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554" id="83101900-2f12-4855-838e-36b8a9e04554">
<name>vol1</name>
...
</gluster_volume>
<gluster_volume href="/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554" id="83101900-2f12-4855-838e-36b8a9e04554">
<name>vol1</name>
...
</gluster_volume>
| Attribute | Type | Description | Properties |
|---|---|---|---|
id | GUID | Each resource in the storage infrastructure contains an id, which acts as a globally unique identifier (GUID). The GUID is the primary method of resource identification. |
|
href | string | The canonical location of the resource as an absolute path. |
|
7.2. Collections Copy linkLink copied to clipboard!
7.2.1. Listing All Resources in a Collection Copy linkLink copied to clipboard!
GET request on the collection URI obtained from the entry point.
7.2.2. Listing Extended Resource Sub-Collections Copy linkLink copied to clipboard!
Accept header includes the detail parameter.
GET /api/collection HTTP/1.1 Accept: application/xml; detail=subcollection
GET /api/collection HTTP/1.1
Accept: application/xml; detail=subcollection
detail parameters:
GET /api/collection HTTP/1.1 Accept: application/xml; detail=subcollection1; detail=subcollection2
GET /api/collection HTTP/1.1
Accept: application/xml; detail=subcollection1; detail=subcollection2
detail parameter that separates the sub-collection with the + operator:
GET /api/collection HTTP/1.1 Accept: application/xml; detail=subcollection1+subcollection2+subcollection3
GET /api/collection HTTP/1.1
Accept: application/xml; detail=subcollection1+subcollection2+subcollection3
| Collection | Extended Sub-Collection Support |
|---|---|
hosts | statistics |
bricks | statistics |
step | statistics |
Example 7.1. An request for extended statistics in the servers collection
GET /api/hosts HTTP/1.1 Accept: application/xml; detail=statistics
GET /api/hosts HTTP/1.1
Accept: application/xml; detail=statistics
7.2.3. Searching Collections with Queries Copy linkLink copied to clipboard!
GET request on a "collection/search" link results in a search query of that collection. The API only returns resources within the collection that satisfy the search query constraints.
7.2.3.1. Query Syntax Copy linkLink copied to clipboard!
query with a GET request:
GET /api/collection?search={query} HTTP/1.1
Accept: application/xml
GET /api/collection?search={query} HTTP/1.1
Accept: application/xml
query template value refers to the search query the API directs to the collection. This query uses the same format as Red Hat Gluster Storage Console search query language:
(criteria) [sortby (element) asc|desc]
sortby clause is optional and only needed when ordering results.
| Collection | Criteria | Result |
|---|---|---|
volumes | type=REPLICATE | Displays a list of all replicate volumes |
events | severity>normal sortby time | Displays the list of all events with severity higher than normal and sorted by the time element values. |
events | severity>normal sortby time desc | Displays the list of all events with severity higher than normal and sorted by the time element values in descending order. |
query template to be URL-encoded to translate reserved characters, such as operators and spaces.
Example 7.2. URL-encoded search query
GET /api/events?search=severity%3Derror HTTP/1.1 Accept: application/xml
GET /api/events?search=severity%3Derror HTTP/1.1
Accept: application/xml
Important
7.2.3.2. Wildcards Copy linkLink copied to clipboard!
Example 7.3. Wildcard search query for name=server*
GET /api/hosts?search=name%3Dserver* HTTP/1.1 Accept: application/xml
GET /api/hosts?search=name%3Dserver* HTTP/1.1
Accept: application/xml
server, such as server-1, server-2, or server-data.
Example 7.4. Wildcard search query for name=s*1
GET /api/hosts?search=name%3D*1 HTTP/1.1 Accept: application/xml
GET /api/hosts?search=name%3D*1 HTTP/1.1
Accept: application/xml
s and ending with 1, such as server1 or server-1 .
7.2.3.3. Pagination Copy linkLink copied to clipboard!
page command.
Example 7.5. Paginating resources
GET /api/collection?search=page%201 HTTP/1.1 Accept: application/xml
GET /api/collection?search=page%201 HTTP/1.1
Accept: application/xml
page value to view the next page of results.
GET /api/collection?search=page%202 HTTP/1.1 Accept: application/xml
GET /api/collection?search=page%202 HTTP/1.1
Accept: application/xml
page command also in conjunction with other commands in a search query. For example:
GET /api/collection?search=sortby%20element%20asc%20page%202 HTTP/1.1 Accept: application/xml
GET /api/collection?search=sortby%20element%20asc%20page%202 HTTP/1.1
Accept: application/xml
7.2.4. Creating a Resource in a Collection Copy linkLink copied to clipboard!
POST request to the collection URI containing a representation of the new resource.
POST request requires a Content-Type: application/xml header. This informs the API of the XML representation in the body content as part of the request.
fault representation indicating the missing elements.
Location header in the response gives the URI of the queried resource. The response body contains either a complete representation, partial representation or no representation of the resource. It is recommended that clients rely only on fetching the representation via the URI in the response header.
7.3. Resources Copy linkLink copied to clipboard!
7.3.1. Retrieving a Resource Copy linkLink copied to clipboard!
GET request on a URI obtained from a collection listing.
7.3.2. Updating a Resource Copy linkLink copied to clipboard!
PUT request containing an updated description from a previous GET request for the resource URI. Details on modifiable properties are found in the individual resource type documentation.
PUT request requires a Content-Type: application/xml header. This informs the API of the XML representation in the body content as part of the request.
409 Conflict error with a fault representation in the response body.
7.3.3. Deleting a Resource Copy linkLink copied to clipboard!
DELETE request sent to its URI.
DELETE /api/collection/resource_id HTTP/1.1 Accept: application/xml HTTP/1.1 204 No Content
DELETE /api/collection/resource_id HTTP/1.1
Accept: application/xml
HTTP/1.1 204 No Content
DELETE request to specify additional properties. A DELETE request with optional body content requires a Content-Type: application/xml header to inform the API of the XML representation in the body content. If a DELETE request contains no body content, omit the Content-Type: application/xml header.
7.3.4. Sub-Collection Relationships Copy linkLink copied to clipboard!
- 1:N mappings, where mapped resources are dependent on a parent resources. Without the parent resource, the dependent resource cannot exist. For example, the link between a volume and its bricks.
- 1:N mappings, where mapped resources exist independently from parent resources but data is still associated with the relationship. For example, the link between a network and a cluster.
link rel= attribute:
7.3.5. XML Element Relationships Copy linkLink copied to clipboard!
- Backlinks from a resource in a sub-collection to a parent resource; or
- Links between resources with an arbitrary relationship.
Example 7.6. Backlinking from a sub-collection resource to a resource using an XML element
7.3.6. Actions Copy linkLink copied to clipboard!
POST request to the supplied URI. The body of the POST requires an action representation encapsulating common and task-specific parameters.
| Element | Description |
|---|---|
async | If true, the server responds immediately with 202 Accepted and an action representation contains a href link to be polled for completion. |
grace_period | a grace period in milliseconds, which must expire before the action is initiated. |
fault response.
Content-Type: application/xml header since the POST request requires an XML representation in the body content.
202 Accepted response provides a link to monitor the status of the task:
GET on the action URI provides an indication of the status of the asynchronous task.
| Status | Description |
|---|---|
pending | Task has not yet started. |
in_progress | Task is in operation. |
complete | Task completed successfully. |
failed | Task failed. The returned action representation would contain a fault describing the failure. |
GETs are 301 Moved Permanently redirected back to the target resource.
rel attribute:
| Type | Description |
|---|---|
parent | A link back to the resource of this action. |
replay | A link back to the original action URI. POSTing to this URI causes the action to be re-initiated. |
7.3.7. Permissions Copy linkLink copied to clipboard!
permissions sub-collection. Each permission contains a user, an assigned role and the specified resource. For example:
POST request with a permission representation and a Content-Type: application/xml header to the resource's permissions sub-collection. Each new permission requires a role and a user:
7.3.8. Handling Errors Copy linkLink copied to clipboard!
fault representation in the response entity body. The fault contains a reason and detail strings. Clients must accommodate failed requests via extracting the fault or the expected resource representation depending on the response status code. Such cases are clearly indicated in the individual resource documentation.
Chapter 8. Clusters Copy linkLink copied to clipboard!
clusters collection provides information about clusters in a Red Hat Gluster Storage environment. An API user accesses this information through the rel="clusters" link obtained from the entry point URI (see Chapter 5, Entry Point).
| Element | Type | Description | Properties |
|---|---|---|---|
link rel="networks" | relationship | A link to the sub-collection for networks associated with this cluster. | |
link rel="permissions" | relationship | A link to the sub-collection for cluster permissions. See Section 7.3.7, “Permissions”. | |
version major= minor= | complex | The compatibility level of the cluster. |
|
supported_versions | complex | A list of possible version levels for the cluster. |
|
gluster_service | boolean | defines whether gluster services are enabled on the cluster. Is always true in Red Hat Gluster Storage Console | |
virt_service | boolean | defines whether virtualization services are enabled on the cluster. Is always false in Red Hat Gluster Storage Console. |
Example 8.1. An XML representation of a cluster
name and server elements. Identify the server with id attribute and name element. name element is mandatory. See Section 7.2.4, “Creating a Resource in a Collection” for more information.
Example 8.2. Creating a cluster
Example 8.3. Updating a cluster
DELETE request.
Example 8.4. Removing a cluster
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95 HTTP/1.1 HTTP/1.1 204 No Content
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95 HTTP/1.1
HTTP/1.1 204 No Content
8.1. Networks Sub-Collection Copy linkLink copied to clipboard!
networks sub-collection. Every host within a cluster connects to these associated networks.
network sub-collection is the same as a standard network resource with an additional cluster id= to signify a relationship to the cluster and a display element to represent the display network status in the cluster.
networks sub-collection as described in Chapter 7, Common Features. POSTing a network id or name reference to the networks sub-collection associates the network with the cluster.
Example 8.5. Associating a network resource with a cluster
PUT request to specify the Boolean value (true or false) of the display element.
Example 8.6. Setting the display network status
DELETE request to the appropriate element in the collection.
Example 8.7. Removing a network association from a cluster
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/da05ac09-00be-45a1-b0b5-4a6a2438665f HTTP/1.1
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/networks/da05ac09-00be-45a1-b0b5-4a6a2438665f HTTP/1.1
8.2. Gluster Hooks Copy linkLink copied to clipboard!
glusterhooks collection provides information about Gluster Hooks in a Red Hat Gluster Storage environment. An API user accesses this information through the rel="glusterhooks" link obtained from the entry point URI (see Chapter 5, Entry Point).
Note
| Element | Type | Description | Properties |
|---|---|---|---|
cluster | relationship | A reference to the cluster that includes this hook. | locked |
name | string | The name of the hook script | Read only |
gluster_command | string | gluster volume command for which the hook is executed | read only |
stage | string | stage of the command; PRE or POST | read only |
content_type | string | TEXT or BINARY | read only |
checksum | string | md5 checksum of the hook script | read only |
content | string | content of the hook script | read only |
conflict_status | integer | bit representation of the conflict detected for the hook. First bit is for content, second is for status and third is for missing hooks. | read only |
conflicts | string | comma separated list of conflict | read only |
status | One of enabled or disabled | The status of the hook. | update |
Example 8.8. An XML representation of Gluster Hook Collection
8.2.1. Managing Gluster Hooks Copy linkLink copied to clipboard!
8.2.1.1. Listing Gluster Hooks Copy linkLink copied to clipboard!
GET request on the volume URI.
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glusterhooks HTTP/1.1 Accept: application/xml
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glusterhooks HTTP/1.1
Accept: application/xml
8.2.1.2. Enabling Gluster Hooks Copy linkLink copied to clipboard!
POST request to its URI.
POST /api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/747bbb9e-ace6-424b-be31-16b33e02d882/enable HTTP/1.1 Accept: application/xml
POST /api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/747bbb9e-ace6-424b-be31-16b33e02d882/enable
HTTP/1.1
Accept: application/xml
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/419590b8-5aa0-473b-9651-aa41f1372c59/glusterhooks/747bbb9e-ace6-424b-be31-16b33e02d882/enable -d "<action/>"
8.2.1.3. Resolving Gluster Hook Conflict Copy linkLink copied to clipboard!
POST request. MISSING_HOOK, CONTENT_CONFLICT, and STATUS_CONFLICT are the types of conflict that can be resolved on a cluster.
- Missing Hook Conflict:
MISSING_HOOKconflict can be resolved either by adding the hook to the host where it is missing or by removing it from all hosts and from the Red Hat Gluster Storage Console by issuing aDELETErequest.cURL command to resolve missing hook conflict by adding hook:curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glusterhooks/59ecbacb-1ce3-43f7-82e4-55db8ed74f56/resolve -d "<action><resolution_type>ADD</resolution_type></action>"The API returns the following representation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow cURL command to resolve missing hook conflict by deleting hook:curl -X DELETE -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glusterhooks/18782869-3e62-42a5-a59d-91f896afd5d7<action> <job href="/api/jobs/3dd9800f-a8c6-4f58-a3cf-dff190d2f06f" id="3dd9800f-a8c6-4f58-a3cf-dff190d2f06f"/> <status><state>complete</state> </status> </action>
<action> <job href="/api/jobs/3dd9800f-a8c6-4f58-a3cf-dff190d2f06f" id="3dd9800f-a8c6-4f58-a3cf-dff190d2f06f"/> <status><state>complete</state> </status> </action>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Content ConflictThis conflict can be resolved with the
resolution_type = copy. If the version of the hook is incorrect in Red Hat Gluster Storage Console, the content is copied from a host by passing the host.name parameter. If the host.name parameter is empty, then the content is copied from Red Hat Gluster Storage Console to all host where content is differentcURL command:curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glusterhooks/59ecbacb-1ce3-43f7-82e4-55db8ed74f56/resolve -d "<action><resolution_type>COPY</resolution_type><host><name>host.name</name></host></action>"The API returns the following representation:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Status ConflictThis conflict is resolved by either enabling or disabling a hook in a cluster.
Chapter 9. Hosts Copy linkLink copied to clipboard!
hosts collection provides information about the hosts in a Red Hat Gluster Storage environment. An API user accesses this information through the rel="hosts" link obtained from the entry point URI (see Chapter 5, Entry Point).
| Element | Type | Description | Properties |
|---|---|---|---|
link rel="nics" | relationship | A link to the nics sub-collection for host network interfaces. | |
link rel="tags" | relationship | A link to the tags sub-collection for host tags. | |
link rel="permissions" | relationship | A link to the permissions sub-collection for host permissions. See Chapter 7, Common Features. | |
link rel="statistics" | relationship | A link to the statistics sub-collection for host statistics. |
|
address | string | The IP address or hostname of the host. |
|
status | See below | The host status. |
|
cluster id= | GUID | A reference to the cluster that includes this host. | |
port | integer | The listen port of the VDSM daemon running on this host. |
|
iscsi | complex | The SCSI initiator for the host. |
|
cpu | complex | Statistics for the host CPU. Includes sub-elements for the CPU's name, topology cores=, topology sockets= and speed. The topology cores= aggregates the total cores while the topology sockets= aggregates the total physical CPUs. |
|
version major= minor= | complex | The compatibility level of the host. |
|
root_password | string | The root password of this host, by convention only included in the client-provided host representation on creation. |
|
status contains one of the following enumerative values: down, error, initializing, installing, install_failed, maintenance, non_operational, non_responsive, pending_approval, preparing_for_maintenance, connecting, reboot, unassigned and up. These states are listed in host_states under capabilities.
Example 9.1. An XML representation of a host
name, address and root_password elements. See Section 7.2.4, “Creating a Resource in a Collection” for more information.
Example 9.2. Creating a host
root_password element is only included in the client-provided initial representation and is not exposed in the representations returned from subsequent requests.
name and cluster elements are updatable post-creation. See Section 7.3.2, “Updating a Resource” for more information.
Example 9.3. Updating a host
DELETE request.
Example 9.4. Removing a host
DELETE /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3 HTTP/1.1 204 No Content
DELETE /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3
HTTP/1.1 204 No Content
9.1. Network Interface Sub-Collection Copy linkLink copied to clipboard!
nics sub-collection represents a host's physical network interfaces. Each host_nic element in the representation acts as a network interface and contains the following elements:
Note
| Element | Type | Description | Properties |
|---|---|---|---|
name | string | The name of the host network interface, e.g. eth0 |
[a]
|
link rel="statistics" | relationship | A link to the statistics sub-collection for a host's network interface statistics. |
|
link rel="master" | relationship | A reference to the master bonded interface, if this is a slave interface. |
|
host id= | GUID | A reference to the host. |
|
network id= | GUID | A reference to the network, if any, that the interface is attached. |
[b] |
mac address= | string | The MAC address of the interface. |
|
ip address= netmask= gateway= | complex | The IP level configuration of the interface. | |
boot_protocol | enumerated | The protocol for IP address assignment when the host is booting. A list of enumerated values is available in capabilities. | |
speed | integer | The network interface speed in bits per second. |
|
status | enumerated | The link status for the network interface. These states are listed in host_nic_states under capabilities. |
|
vlan id | integer | The VLAN which this interface represents. |
|
bonding | complex | A list of options and slave NICs for bonded interfaces. |
[c]
|
[a]
Only required when adding bonded interfaces. Other interfaces are read-only and cannot be added.
[b]
Only required when adding bonded interfaces. Other interfaces are read-only and cannot be added.
[c]
Only required when adding bonded interfaces. Other interfaces are read-only and cannot be added.
| |||
Example 9.5. An XML representation of a network interface on a host
network, ip and boot_protocol elements using a PUT request.
name and network elements are required. Identify the network element with the id attribute or name element.
PUT request.
DELETE request.
DELETE /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/nics/ e8f02fdf-3d7b-4135-86e1-1bf185570cd8 HTTP/1.1 HTTP/1.1 204 No Content
DELETE /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/nics/
e8f02fdf-3d7b-4135-86e1-1bf185570cd8 HTTP/1.1
HTTP/1.1 204 No Content
9.1.1. Bonded Interfaces Copy linkLink copied to clipboard!
host_nic resource containing a bonding element.
| Element | Type | Description | Properties |
|---|---|---|---|
options | complex | A list of option elements for a bonded interface. Each option contains property name and value attributes. |
[a]
|
slaves | complex | A list of slave host_nic id= elements for a bonded interface. |
[b]
|
[a]
Only required when adding bonded interfaces. Other interfaces are read-only and cannot be added.
[b]
Only required when adding bonded interfaces. Other interfaces are read-only and cannot be added.
| |||
POSTing to a host_nic with bonding options and slave interfaces. The name, network and bonded elements are required when creating a new bonded interface. Either the id or name elements identify the network and slave host_nics.
Example 9.6. Creating a bonded interface
Important
bond0, bond1, bond2, bond3 and bond4 are the only valid names for a bonded interface.
DELETE request to a bonded interface URI deletes it.
Important
9.1.2. Network Interface Statistics Copy linkLink copied to clipboard!
statistics sub-collection for a host's network interface statistics. Each statistic contains the following elements:
| Element | Type | Description |
|---|---|---|
name | string | The unique identifier for the statistic entry. |
description | string | A plain text description of the statistic. |
unit | string | The unit or rate to measure the statistical values. |
type | One of GAUGE or COUNTER | The type of statistic measures. |
values type= | One of INTEGER or DECIMAL | The data type for the statistical values that follow. |
value | complex | A data set that contains datum. |
datum | see values type | An individual piece of data from a value. |
host_nic id= | relationship | A relationship to the containing host_nic resource. |
|
Name
|
Description
|
|---|---|
data.current.rx |
The rate in bytes per second of data received.
|
data.current.tx |
The rate in bytes per second of data transmitted.
|
errors.total.rx |
Total errors from receiving data.
|
errors.total.tx |
Total errors from transmitting data.
|
Example 9.7. An XML representation of a host's network interface statistics sub-collection
Note
statistics sub-collection is read-only.
9.1.3. Attach Action Copy linkLink copied to clipboard!
id or name elements identify the network.
Example 9.8. Action to attach a host network interface to a network
Important
9.1.4. Detach Action Copy linkLink copied to clipboard!
id or name elements identify the network.
Example 9.9. Action to detach a host network interface to a network
Important
9.2. Statistics Sub-Collection Copy linkLink copied to clipboard!
statistics sub-collection for host-specific statistics. Each statistic contains the following elements:
| Element | Type | Description |
|---|---|---|
name | string | The unique identifier for the statistic entry. |
description | string | A plain text description of the statistic. |
unit | string | The unit or rate to measure the statistical values. |
type | One of GAUGE or COUNTER | The type of statistic measures. |
values type= | One of INTEGER or DECIMAL | The data type for the statistical values that follow. |
value | complex | A data set that contains datum. |
datum | see values type | An individual piece of data from a value. |
host id= | relationship | A relationship to the containing host resource. |
|
Name
|
Description
|
|---|---|
memory.total |
Total memory in bytes on the host.
|
memory.used |
Memory in bytes used on the host.
|
memory.free |
Memory in bytes free on the host.
|
memory.buffers |
I/O buffers in bytes.
|
memory.cached |
OS caches in bytes.
|
swap.total |
Total swap memory in bytes on the host.
|
swap.free |
Swap memory in bytes free on the host.
|
swap.used |
Swap memory in bytes used on the host.
|
swap.cached |
Swap memory in bytes also cached in host's memory.
|
ksm.cpu.current |
Percentage of CPU usage for Kernel SamePage Merging.
|
cpu.current.user |
Percentage of CPU usage for users.
|
cpu.current.system |
Percentage of CPU usage for system.
|
cpu.current.idle |
Percentage of idle CPU usage.
|
cpu.load.avg.5m |
CPU load average per five minutes.
|
Example 9.10. An XML representation of the host's statistics sub-collection
Note
statistics sub-collection is read-only.
9.3. Actions Copy linkLink copied to clipboard!
host resources.
install, activate, fence, deactivate, approve, iscsilogin, iscsidiscover and commitnetconfig.
9.3.1. Install Action Copy linkLink copied to clipboard!
- Red Hat Enterprise Linux host - This host type requires a
root_passwordelement that refers to the password for the host'srootuser.
Example 9.11. Action to install VDSM to a Red Hat Enterprise Linux host
9.3.2. Activate Action Copy linkLink copied to clipboard!
Example 9.12. Action to activate a host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/activate HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/activate HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
9.3.3. Fence Action Copy linkLink copied to clipboard!
fence action. The capabilities lists available fence_type options.
Example 9.13. Action to fence a host
9.3.4. Deactivate Action Copy linkLink copied to clipboard!
Example 9.14. Action to deactivate a host
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/deactivate HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/deactivate HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
9.3.5. Commit Network Configuration Action Copy linkLink copied to clipboard!
Example 9.15. Action to commit network configuration
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/commitnetconfig HTTP/1.1 Accept: application/xml Content-type: application/xml <action/>
POST /api/hosts/2ab5e1da-b726-4274-bbf7-0a42b16a0fc3/commitnetconfig HTTP/1.1
Accept: application/xml
Content-type: application/xml
<action/>
Important
Chapter 10. Volumes Copy linkLink copied to clipboard!
volumes collection provides information about volumes in a Red Hat Gluster Storage environment.
| Element | Type | Description | Properties |
|---|---|---|---|
volumeName | relationship | Name of the volume to be created. |
|
volumeType | relationship | DISTRIBUTE, REPLICATE, DISTRIBUTED_REPLICATE. |
|
replicaCount | complex | replicaCount is mandatory if volumeType is REPLICATE or DISTRIBUTED_REPLICATE |
|
bricks | complex | list of bricks of a volume. You can add/remove bricks to/from a volume. |
|
| options | complex | list of options of the volume |
Example 10.1. An XML representation of a volume
10.1. Creating a Volume Copy linkLink copied to clipboard!
volumeName, volumeType,transportType and brick elements. The API creates a new volume with a POST request to the URI containing a representation of the new volume
Example 10.2. Creating a volume
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes -d "<gluster_volume><name>data</name><volume_type>DISTRIBUTE</volume_type><bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick1</brick_dir></brick><brick><server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id><brick_dir>/export/data/brick2</brick_dir></brick></bricks></gluster_volume>"
10.2. Listing Volumes Copy linkLink copied to clipboard!
GET request on the cluster URI.
Example 10.3. Listing Volumes
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes HTTP/1.1 Accept: application/xml
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes HTTP/1.1
Accept: application/xml
curl -X GET -H "Accept: application/xml" -u [USER:PASS] https://[RHGSC Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes
10.3. Managing Volumes Copy linkLink copied to clipboard!
POST request to the URI.
10.3.1. Starting a Volume Copy linkLink copied to clipboard!
POST request to the volumes URI.
Example 10.4. Starting a Volume
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/start -d "<action/>"
<action>
<status>
<state>complete</state>
</status>
</action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.2. Stopping a Volume Copy linkLink copied to clipboard!
POST request.
Example 10.5. Stopping a Volume
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/stop -d "<action/>"
<action>
<status>
<state>complete</state>
</status>
</action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.3. Removing a Volume Copy linkLink copied to clipboard!
DELETE request.
Example 10.6. Removing a Volume
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27 HTTP/1.1 HTTP/1.1 204 No Content
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27 HTTP/1.1
HTTP/1.1 204 No Content
curl -X DELETE -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554"
10.3.4. Setting a Volume Option Copy linkLink copied to clipboard!
POST request to the volume URI.
Example 10.7. Setting a Volume Option
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS]https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/setOption -d "<action><option name="key" value="value" /></action>"
10.3.5. Resetting a Volume Option Copy linkLink copied to clipboard!
POST request.
Example 10.8. Resetting a Volume Option
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532- 9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/resetOption -d "<action><option name="key" value="value"/><force>true</force></action>"
<action>
<status>
<state>complete</state>
</status>
</action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.6. Resetting all Volume Options Copy linkLink copied to clipboard!
POST request.
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/resetAllOptions HTTP/1.1 Accept: application/xml Content-type: application/xml
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/resetAllOptions HTTP/1.1
Accept: application/xml
Content-type: application/xml
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/resetAllOptions -d "<action/>"
<action>
<status>
<state>complete</state>
</status>
</action>
<action>
<status>
<state>complete</state>
</status>
</action>
10.3.7. Rebalancing Volume Copy linkLink copied to clipboard!
POST request. The status of rebalance operation can be monitored by job id returned by this API.
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/rebalance -d "<action/>" HTTP/1.1 Accept: application/xml Content-type: application/xml
POST /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/ceb59bbb-173d-4a5a-9b92-0189a17eae27/rebalance -d "<action/>"
HTTP/1.1
Accept: application/xml
Content-type: application/xml
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/rebalance -d "<action/>"
/api/jobs/<job_id>/steps /api/jobs/<job_id>/steps/<step_id> --for step type rebalance /api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of rebalance status per node
/api/jobs/<job_id>/steps
/api/jobs/<job_id>/steps/<step_id> --for step type rebalance
/api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of rebalance status per node
Example 10.9. Monitoring Rebalance
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC-Host]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/stoprebalance -d "<action/>"
10.4. Managing Bricks Copy linkLink copied to clipboard!
10.4.1. Listing of Bricks Copy linkLink copied to clipboard!
GET request on the volume URI.
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks HTTP/1.1 Accept: application/xml
GET /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks HTTP/1.1
Accept: application/xml
10.4.2. Adding a Brick Copy linkLink copied to clipboard!
POST request to its URI.
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks -d "<bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick3</brick_dir></brick></bricks>"
10.4.3. Removing a Brick Copy linkLink copied to clipboard!
DELETE request sent to its URI. Before removing a brick, data must be migrated to ensure there is no data loss with a POST request sent to its URI.
POST /api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/bricks/migrate -d "<action><bricks><brick><name>host:brick_dir</name></brick></bricks></action>"
POST /api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/bricks/migrate -d "<action><bricks><brick><name>host:brick_dir</name></brick></bricks></action>"
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" [USER:PASS] https://[RHGSC HOST]/api/clusters/44571c63-a110-4fba-9a8c-7b30446ba8bf/glustervolumes/380474af-360b-48fa-a210-9c08b913ffa3/bricks/migrate -d "<action><bricks><brick><name>host:brick_dir</name></brick></bricks></action>"
/api/jobs/<job_id>/steps /api/jobs/<job_id>/steps/<step_id> --for step type remove brick /api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of remove brick
/api/jobs/<job_id>/steps
/api/jobs/<job_id>/steps/<step_id> --for step type remove brick
/api/jobs/<job_id>/steps/<step_id>/statistics -- for detail information of remove brick
DELETE request for a brick(s).
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks
DELETE /api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks
curl -X DELETE -u [USER:PASS] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes/83101900-2f12-4855-838e-36b8a9e04554/bricks -d "<bricks><brick><name>host:brick_dir</brick></bricks>"
Chapter 11. Groups Copy linkLink copied to clipboard!
groups collection contains imported groups from directory services.
group resource contains a set of elements.
| Element | Type | Description |
|---|---|---|
link rel="tags" | relationship | A link to the tags sub-collection for tags attached to this group. |
link rel="permissions" | relationship | A link to the permissions sub-collection for permissions attached to this group. |
link rel="roles" | relationship | A link to the roles sub-collection for roles attached to this group. |
Example 11.1. An XML representation of a group resource
Chapter 12. Roles Copy linkLink copied to clipboard!
rel="roles" link obtained from the entry point URI (see Chapter 5, Entry Point) provides access to a static set of system roles.
role element contains the following:
| Element | Type | Description | Properties |
|---|---|---|---|
link="permits" | relationship | A link to the permits sub-collection for role permits. |
|
mutable | Boolean: true or false | Defines the ability to update or delete the role. Roles with mutable set to false are roles built into the Red Hat Gluster Storage Console environment. |
|
administrative | Boolean: true or false | Defines the role as administrative-only. |
Example 12.1. An XML representation of the roles collection
name, administrative and a list of initial permits. See Section 7.2.4, “Creating a Resource in a Collection” for more information.
Example 12.2. Creating a role
name, description and administrative elements are updatable post-creation. See Section 7.3.2, “Updating a Resource” for more information.
Example 12.3. Updating a role
DELETE request.
Example 12.4. Removing a role
DELETE /api/roles/8de42ad7-f307-408b-80e8-9d28b85adfd7 HTTP/1.1 204 No Content
DELETE /api/roles/8de42ad7-f307-408b-80e8-9d28b85adfd7
HTTP/1.1 204 No Content
12.1. Permits Sub-Collection Copy linkLink copied to clipboard!
permits, which the API lists in capabilities.
permits are listed as a sub-collection:
Example 12.5. Listing a role's permits
permit to a role with a POST request to the permits sub-collection. Use either an id attribute or a name element to specify the permit to assign.
Example 12.6. Assign a permit to a role
permit from a role with a DELETE request to the permit resource.
Example 12.7. Remove a permit from a role
DELETE /api/roles/b67dfbe2-0dbc-41e4-86d3-a2fbef02cfa9/permits/ HTTP/1.1 204 No Content
DELETE /api/roles/b67dfbe2-0dbc-41e4-86d3-a2fbef02cfa9/permits/
HTTP/1.1 204 No Content
Chapter 13. Users Copy linkLink copied to clipboard!
rel="users" link. Individual user elements contain the following:
| Element | Type | Description | Properties |
|---|---|---|---|
user_name | string | The user principal name (UPN). The UPN is used as a more convenient identifier when adding a new user. |
|
link rel="tags" | relationship | A link to the tags sub-collection for user resources. | |
link rel="roles" | relationship | A link to the roles sub-collection for user resources. | |
name | string | A free-text name for the user. |
|
domain | string | The containing directory service domain. |
|
groups | complex | A list of directory service groups for this user. |
|
Example 13.1. An XML representation of a user resource
POST request to the users collection. The client-provided new user representation includes an embedded roles list with at least one initial role to assign to the user. For example, the following request assigns two initial roles to the user joe@domain.example.com:
Example 13.2. Adding a user from directory service and assigning two roles
Note
domains collection prior to creation of the user.
POST or DELETE requests to the roles sub-collection of an individual user. The example below illustrates how the API adds the RHSCUser role to the role assignments for a particular user.
Note
user element is only used for the initial creation. All interactions post-creation with the user's role assignments go through the roles sub-collection.
Example 13.3. Adding roles to a user
Note
PUT verb. The only changes allowed post-creation are in the user's role assignments.
DELETE request on the users collection. The directory service domain remains unchanged after such a deletion.
Chapter 14. Events Copy linkLink copied to clipboard!
rel="events" link obtained from the entry point URI accesses the events collection and lists system events from Red Hat Gluster Storage Console.
| Element | Type | Description |
|---|---|---|
description | string | A description of the system event. |
code | integer | The integer event code. |
severity | One of normal, warning, error or alert | The level of severity for the event. |
time | xsd:dateTime format: YYYY-MM-DDThh:mm:ss | The timestamp indicating when the event happened. |
user id | GUID | The identification code for the user who triggered the event. |
Example 14.1. An XML representation of the events collection
user, an event representation also contains a set of XML element relationships to resources relevant to the event.
Example 14.2. An XML representation of a volume start event
Default cluster .
Note
events collection is read-only.
14.1. Searching Events Copy linkLink copied to clipboard!
events collection provides search queries similar to other resource collections (see Section 7.2.3, “Searching Collections with Queries”). An additional feature when searching the events collection is the ability to search from a certain event. This queries all of events since a specified event.
from argument added to the URI after the query. This from argument references an event id code.
Example 14.3. Searching from an event
GET /api/events?search=type%3D30&from=1012 HTTP/1.1 Accept: application/xml
GET /api/events?search=type%3D30&from=1012 HTTP/1.1
Accept: application/xml
type set to 30 since id="1012"
14.2. Paginating Events Copy linkLink copied to clipboard!
page command in a search query.
page value in combination with the sortby clause:
sortby time asc page 1
sortby clause defines the base element to order of the results and whether the results are ascending or descending. For search queries of events, set the base element to time and the order to ascending (asc) so the API displays all events from the creation of your storage environment.
page condition defines the page number. One page equals the default number of events to list. Pagination begins at page 1. To view more pages, increase the page value:
sortby time asc page 2
sortby time asc page 3
sortby time asc page 4
Example 14.4. Paginating events
event resources. The URL-encoded request is:
GET /api/events?search=sortby%20time%20asc%20page%201 HTTP/1.1 Accept: application/xml
GET /api/events?search=sortby%20time%20asc%20page%201 HTTP/1.1
Accept: application/xml
page value to view the next page of results.
GET /api/events?search=sortby%20time%20asc%20page%202 HTTP/1.1 Accept: application/xml
GET /api/events?search=sortby%20time%20asc%20page%202 HTTP/1.1
Accept: application/xml
from argument to set the starting id.
GET /api/events?search=sortby%20time%20asc%20page%202&from=30 HTTP/1.1 Accept: application/xml
GET /api/events?search=sortby%20time%20asc%20page%202&from=30 HTTP/1.1
Accept: application/xml
Part III. Python Software Development Kit Copy linkLink copied to clipboard!
Chapter 15. Software Development Kit Overview Copy linkLink copied to clipboard!
15.1. Introduction to the Red Hat Gluster Storage Software Development Kit Copy linkLink copied to clipboard!
15.2. Software Development Kit Prerequisites Copy linkLink copied to clipboard!
- A system with Red Hat Enterprise Linux 6, or later, installed. Both the Server and Workstation variants are supported.
- A subscription to Red Hat Gluster Storage entitlements.
rhsc-sdk package, the Python 2.6 interpreter will be installed if it does not already exist on the system.
Important
rhsc-sdk package must be installed. As a result, the prerequisites listed here must be met both on the systems being used to develop scripts using the software development kit, and on those systems on which the scripts are intended to run.
15.3. Installing the Software Development Kit Copy linkLink copied to clipboard!
The software development kit is provided by the rhsc-sdk package. This package includes all of the Python bindings for the Red Hat Gluster Storage Console API. To begin using the software development kit, you must install the rhsc-sdk package on the system that you wish to use for script development. The instructions that appear here are intended for use on a system running Red Hat Enterprise Linux 6 or later.
Procedure 15.1. Installing the Python SDK
- Ensure that your system has the required entitlements:
- When using certificate-based Red Hat Network, you must subscribe to the
Red Hat Gluster Storageentitlement to install therhsc-sdkpackage. - When using Red Hat Network classic, you must subscribe to the
Red Hat Gluster Storage Consolechannel to install therhsc-sdkpackage. Refer to the Red Hat Gluster Storage Console Installation Guide for specific channel names current to your system.
- Ensure that you are logged in as the
rootuser. - Install the
rhsc-sdkpackage using theyumcommand.yum install rhsc-sdk
# yum install rhsc-sdkCopy to Clipboard Copied! Toggle word wrap Toggle overflow ResultTherhsc-sdkpackage is now installed. TheovirtsdkPython library is now available for use on the local system.
Chapter 16. Using the Software Development Kit Copy linkLink copied to clipboard!
16.1. Connecting to the API Using Python Copy linkLink copied to clipboard!
API class from the ovirtsdk.api module. To be able to do this, it is necessary to first import the class at the start of the script:
from ovirtsdk.api import API
from ovirtsdk.api import API
API class takes a number of arguments. Supported arguments are:
-
url - Specifies the URL of the Manager to connect to, including the
/apipath. This parameter is mandatory. -
username - Specifies the user name to use when connecting, in the User Principle Name (UPN) format. This parameter is mandatory.
-
password - Specifies the password for the user provided by the
usernameparameter. This parameter is mandatory. -
key_file - Specifies a PEM-formatted key file containing the private key associated with the certificate specified by
cert_file. This parameter is optional. -
cert_file - Specifies a PEM-formatted client certificate to be used for establishing the identity of the client on the server. This parameter is optional.
-
ca_file - Specifies the certificate file of the certificate authority for the server. This parameter is mandatory unless the
insecureparameter is set toTrue. -
port - Specifies the port to use when connecting, where it has not been provided as component of the
urlparameter. This parameter is optional. -
timeout - Specifies the amount of time in seconds that is allowed to pass before a request is considered to be timed out. This parameter is optional.
-
persistent_auth - Specifies whether persistent authentication is enabled for this connection. Valid values are
TrueandFalse. This parameter is optional and defaults toFalse. -
insecure - Allows a connection via SSL without a certificate authority. Valid values are
TrueandFalse, and the default isFalse. If theinsecureparameter is set toFalsethen the ca_file must be supplied to secure the connection.This option should be used with caution, as it may allow man-in-the-middle (MITM) attackers to spoof the identity of the server. -
filter - Specifies whether or not the user permission based filter is on or off. Valid values are
TrueandFalse, and the default isFalse. If thefilterparameter is set toFalse, the authentication credentials provided must be those of an administrative user. If thefilterparameter is set toTrue, any user can be used and the Console will filter the actions available to the user based on their permissions. -
debug - Specifies whether debug mode is enabled for this connection. Valid values are
TrueandFalse. This parameter is optional.
ovirtsdk.API Python class.
API class, refer to the PyDoc output for the ovirtsdk.api package.
16.2. Listing the Public Attributes of a Resource Copy linkLink copied to clipboard!
dir() method returns a list of public variables, modules, and functions of a resource. The private attribute names start with an underscore character. To get a list of all the public attributes of a resource, use the following code snippet:
for name in (e for e in dir(api) if not e.startswith('_')):
print name
for name in (e for e in dir(api) if not e.startswith('_')):
print name
Figure 16.1. Object Hierarchy
Figure 16.2. Relationship between a brick and a host
Figure 16.3. Relationship between a host and a cluster
16.3. Resources and Collections Copy linkLink copied to clipboard!
- Collections
- A collection is a set of resources of the same type. The API provides both top-level collections and sub-collections. An example of a top-level collection is the volume collection which contains all bricks in the environment. An example of a sub-collection is the
volume.brickscollection which contains resources for CPUs attached to a cluster.The interface for interacting with collections provides methods for adding resources (add), getting resources (get), and listing resources (list). - Resources
- A resource in a RESTful API is an object with a fixed interface that also contains a set of attributes that are relevant to the specific type of resource being represented. The interface for interacting with resources provides methods for updating (
update) and deleting (delete) resources. Additionally, some resources support actions specific to the resource type. One example of this is theapprovemethod ofHostresources.
16.4. Retrieving Resources from a Collection Copy linkLink copied to clipboard!
get and list methods.
-
get - Retrieves a single resource from the collection. The item to retrieve is determined based on the name provided as an argument. The
getmethod takes these arguments:name- The name of the resource to retrieve from the collection.id- The globally unique identifier (GUID) of the resource to retrieve from the collection.
-
list - Retrieves any number of resources from the collection. The items to retrieve are determined based on the criteria provided. The
listmethod takes these arguments:**kwargs- A dictionary of additional arguments allowing keyword-based filtering.query- A query written in the same format as that used for searches executed using the Red Hat Gluster Storage Console.max- The maximum number of resources to retrieve.case_sensitive- Whether or not search terms are to be treated as case sensitive (TrueorFalse, the default isTrue).
Example 16.1. Retrieving a List of Resources in a Collection Matching a Keyword Based Filter
16.4.1. Retrieving a Specific Resource from a Collection Copy linkLink copied to clipboard!
get method.
name parameter of the get method:
cl = api.clusters.get("Default")
cl = api.clusters.get("Default")
cl = api.clusters.get(name="Default")
cl = api.clusters.get(name="Default")
16.4.2. Retrieving a List of Resources from a Collection Copy linkLink copied to clipboard!
list method.
Example 16.2. Listing All Clusters
get_name() method provides the name of the cluster and the get_gluster_service() returns true or false based on glusterFS support in the cluster:
Example 16.3. Listing All Hosts
api.hosts.list() provides a dictionary list that contains the host name and the host ID.
h1 (51b29199-3a7f-49e4-b0d5-92afdeea1f15) h2 (4e8c3642-e654-456c-9dff-a240c8a43b1f) host1 (14e3823d-d557-4635-bd9f-0c6157ab7f07)
h1 (51b29199-3a7f-49e4-b0d5-92afdeea1f15)
h2 (4e8c3642-e654-456c-9dff-a240c8a43b1f)
host1 (14e3823d-d557-4635-bd9f-0c6157ab7f07)
Important
list method of a collection is restricted to returning only as many elements as allowed by the SearchResultsLimit configuration key in the Red Hat Gluster Storage Console. To ensure that all records in a the list are returned, it is recommended to paginate through the results as illustrated in this example. Alternatively, set the max parameter of the list method to the maximum number of records that you wish to retrieve.
Example 16.4. Listing All Red Hat Gluster Storage Volumes
VolumeName: vol1
VolumeName: vol1
Example 16.5. Listing All Users
User name: admin (User ID: fdfc627c-d875-11e0-90f0-83df133b58cc)
User name: admin (User ID: fdfc627c-d875-11e0-90f0-83df133b58cc)
Example 16.6. Listing All Roles
getUsers() function lists all the roles in the Red Hat Gluster Storage Console.
for i in api.roles.list(): print i.name
for i in api.roles.list():
print i.name
Example 16.7. Listing All Network Details
nic.get_status().get_state() returns the network status as either up or down.
NIC Name: eth0 IPAddress: 10.70.37.194 MAC Address: 00:1a:4a:46:24:9e netStatus: up
NIC Name: eth0
IPAddress: 10.70.37.194
MAC Address: 00:1a:4a:46:24:9e
netStatus: up
nic.get_ip().set_address()nic.get_ip()set_netmask()nic.get_ip().set_gateway()nic.set_bridged()
16.5. Adding a Resource to a Collection Copy linkLink copied to clipboard!
add method adds a resource to a collection. The resource to be added is created based on the parameters provided. Parameters are provided to the add method using an instance of an object from the ovirtsdk.xml.params module. Selecting the specific class from the module to use varies based on the type of resource being created.
Example 16.8. Adding a Resource to a Collection
GlusterBricks collection.
Procedure 16.1. Creating a Red Hat Gluster Storage Resource
- Create an instance of the parameter object for the type of resource being created.
- Identify the collection to which the resource will be added.
- Call the
addmethod of the collection passing the parameter object as a parameter.
16.6. Updating a Resource in a Collection Copy linkLink copied to clipboard!
update method for the resource to save the changes. Parameter modification is performed by using the set_* methods on the retrieved resource:
Example 16.9. Updating a Network Address
def setHostIp(hostName, hostIP):
host = API.hosts.get(hostName)
host.set_address(hostIP)
host.update()
def setHostIp(hostName, hostIP):
host = API.hosts.get(hostName)
host.set_address(hostIP)
host.update()
16.7. Removing a Resource from a Collection Copy linkLink copied to clipboard!
delete method on the resource.
Example 16.10. Removing a Resource from a Collection
cl = api.clusters.get("DemoCluster")
cl.delete()
cl = api.clusters.get("DemoCluster")
cl.delete()
16.8. Handling Errors Copy linkLink copied to clipboard!
ovirtsdk.infrastructure.errors module:
- ConnectionError
- Raised when a transport layer error has occurred.
- DisconnectedError
- Raised when attempting to use SDK after it was explicitly disconnected.
- ImmutableError
- Raised when initiating SDK while an SDK instance already exists under the same domain. Applicable to SDK versions before 3.2.
- NoCertificatesError
- Raised when no CA certificate is provided and
insecureisFalse. - UnsecuredConnectionAttemptError
- Raised when HTTP protocol is used while the server is running HTTPS.
- MissingParametersError
- Raised when using the
get()method without providingidorname.
Example 16.11. ConnectionError Exception
Chapter 17. Python Reference Documentation Copy linkLink copied to clipboard!
17.1. Python Reference Documentation Copy linkLink copied to clipboard!
ovirtsdk.apiovirtsdk.infrastructure.brokers
pydoc generated documentation on your local machine provide the name of the module you are interested in as an argument to the pydoc command:
pydoc MODULE
$ pydoc MODULE
Appendix A. SDK Examples Copy linkLink copied to clipboard!
A.1. Common Functions and Wrappers Copy linkLink copied to clipboard!
A.2. Python SDK Example: Hosts Copy linkLink copied to clipboard!
A.3. Python SDK Example: Cluster Copy linkLink copied to clipboard!
Example A.1. Building a cluster object
api.clusters.add() function.
api.clusters.add(params.Cluster(name="mytest.cluster.3", cpu=params.CPU(id="Intel Nehalem Family"), data_center=dc, virt_service=False, gluster_service=True))
api.clusters.add(params.Cluster(name="mytest.cluster.3", cpu=params.CPU(id="Intel Nehalem Family"),
data_center=dc, virt_service=False, gluster_service=True))
A.4. Python SDK Example: Volumes Copy linkLink copied to clipboard!
api.host collection.
glusterVolumeStart() function.
glusterVolumeStart() function.
startRebalance and stopRebalance functions and the jobID to the rebalanceStatus function.
A.5. Python SDK Example: Bricks Copy linkLink copied to clipboard!
startRemoveBrick and removeBrickStatus
Note
Important
A.6. Python SDK Example: Permissions Copy linkLink copied to clipboard!
def getRoles():
""" Return list of all roles """
return [role.get_name() for role in API.roles.list()]
def getRoles():
""" Return list of all roles """
return [role.get_name() for role in API.roles.list()]
def getRolePermissions(roleName):
""" Return permissions of role """
role = API.roles.get(roleName)
return [perm.get_name() for perm in role.get_permits().list()]
def getRolePermissions(roleName):
""" Return permissions of role """
role = API.roles.get(roleName)
return [perm.get_name() for perm in role.get_permits().list()]
def getSuperUserPermissions():
""" Return SuperUser permissions(all possible permissions) """
return getRolePermissions('SuperUser')
def getSuperUserPermissions():
""" Return SuperUser permissions(all possible permissions) """
return getRolePermissions('SuperUser')
def removeAllPermissionFromCluster(clusterName):
cluster = getObjectByName(API.clusters, clusterName)
removeAllPermissionFromObject(cluster)
def removeAllPermissionFromCluster(clusterName):
cluster = getObjectByName(API.clusters, clusterName)
removeAllPermissionFromObject(cluster)
def removeAllPermissionFromCluster(clusterName):
cluster = getObjectByName(API.clusters, clusterName)
removeAllPermissionFromObject(cluster)
def removeAllPermissionFromCluster(clusterName):
cluster = getObjectByName(API.clusters, clusterName)
removeAllPermissionFromObject(cluster)
A.7. Python SDK Example: Users Copy linkLink copied to clipboard!
def getFilterHeader():
""" Has user admin role or user role? """
return contextmanager.get('filter')
def getFilterHeader():
""" Has user admin role or user role? """
return contextmanager.get('filter')
def loginAsAdmin():
loginAsUser(config.OVIRT_USERNAME,
config.OVIRT_DOMAIN,
config.OVIRT_PASSWORD,
filter_=False)
def loginAsAdmin():
loginAsUser(config.OVIRT_USERNAME,
config.OVIRT_DOMAIN,
config.OVIRT_PASSWORD,
filter_=False)
A.8. Python SDK Example: Hooks Copy linkLink copied to clipboard!
Note
get_status().state. And it will raise an ovirtsdk.infrastructure.errors.RequestError when there is a failure.
Appendix B. API Usage with cURL Copy linkLink copied to clipboard!
A Red Hat Enterprise Linux user installs cURL with the following terminal command:
yum install curl
cURL uses a command line interface to send requests to a HTTP server. Integrating a request requires the following command syntax:
Usage: curl [options]uri
Usage: curl [options]uri
uri refers to target HTTP address to send the request. This is a location on your Red Hat Gluster Storage Console host within the API entry point path (/api).
cURL options
- -X COMMAND, --request COMMAND
- The request command to use. In the context of the REST API, use
GET,POST,PUTorDELETE.Example:-X GET - -H LINE, --header LINE
- HTTP header to include with the request. Use multiple header options if more than one header is required.Example:
-H "Accept: application/xml" -H "Content-Type: application/xml" - -u USERNAME:PASSWORD, --user USERNAME:PASSWORD
- The username and password of the Red Hat Gluster Storage Console user. This attribute acts as a convenient replacement for the
Authorization:header.Example:-u admin@internal:p@55w0rd! - --cacert CERTIFICATE
- The location of the certificate file for SSL communication to the REST API. The certificate file is saved locally on the client machine. Use the
-kattribute to bypass SSL. See Chapter 2, Authentication and Security for more information on obtaining a certificate.Example:--cacert ~/Certificates/rhsc.cer - -d BODY, --data BODY
- The body to send for requests. Use with
POST,PUTandDELETErequests. Ensure to specify theContent-Type: application/xmlheader if a body exists in the request.Example:-d "<bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick3</brick_dir></brick></bricks>"
The following examples show how to adapt REST requests to cURL command syntax:
Example B.1. GET request
GET request lists the clusters in the cluster collection. Note that a GET request does not contain a body.
GET /api/clusters HTTP/1.1 Accept: application/xml
GET /api/clusters HTTP/1.1
Accept: application/xml
GET), header (Accept: application/xml) and URI (https://[RHGSC Host]/api/clusters) into the following cURL command:
curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/clusters
$ curl -X GET -H "Accept: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/clusters
clusters collection displays.
Example B.2. POST request
POST request creates a volume in the server collection. Note that a POST request requires a body.
POST), headers (Accept: application/xml and Content-type: application/xml), URI (https://[RHGSC Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes) and request body into the following cURL command:
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes -d "<gluster_volume><name>data</name><volume_type>DISTRIBUTE</volume_type><bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick1</brick_dir></brick><brick><server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id><brick_dir>/export/data/brick2</brick_dir></brick></bricks></gluster_volume>"
curl -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" -u [USER:PASS] --cacert [CERT] https://[RHGSC HOST]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95/glustervolumes -d "<gluster_volume><name>data</name><volume_type>DISTRIBUTE</volume_type><bricks><brick><server_id>fcb46b88-f32e-11e1-918a-0050568c4349</server_id><brick_dir>/export/data/brick1</brick_dir></brick><brick><server_id>de173e6a-fb05-11e1-a2fc-0050568c4349</server_id><brick_dir>/export/data/brick2</brick_dir></brick></bricks></gluster_volume>"
Example B.3. PUT request
PUT request updates the cluster. Note that a PUT request requires a body.
PUT), headers (Accept: application/xml and Content-type: application/xml), URI (https://[RHGSC Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95) and request body into the following cURL command:
curl -X PUT -H "Accept: application/xml" -H "Content-type: application/xml" -u [USER:PASS] --cacert [CERT] -d "<cluster><description>Cluster 1</description></cluster>" https://[RHGSC Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95
$ curl -X PUT -H "Accept: application/xml" -H "Content-type: application/xml" -u [USER:PASS] --cacert [CERT] -d "<cluster><description>Cluster 1</description></cluster>" https://[RHGSC Host]/api/clusters/99408929-82cf-4dc7-a532-9d998063fa95
Example B.4. DELETE request
DELETE request removes a cluster resource.
DELETE /api/clusters/082c794b-771f-452f-83c9-b2b5a19c0399 HTTP/1.1
DELETE /api/clusters/082c794b-771f-452f-83c9-b2b5a19c0399 HTTP/1.1
DELETE) and URI (https://[RHGSC Host]/api/clusters/082c794b-771f-452f-83c9-b2b5a19c0399) into the following cURL command:
curl -X DELETE -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/clusters/082c794b-771f-452f-83c9-b2b5a19c0399
$ curl -X DELETE -u [USER:PASS] --cacert [CERT] https://[RHGSC Host]/api/clusters/082c794b-771f-452f-83c9-b2b5a19c0399
Accept: application/xml request header is optional due to the empty result of DELETE requests.
In addition the the standard command line tools, cURL also features libcurl, a library for programming language integration. For more information on supported programming languages and integration methods, see the libcurl website (http://curl.haxx.se/libcurl/).
Appendix C. Event Codes Copy linkLink copied to clipboard!
C.1. Event Codes Copy linkLink copied to clipboard!
| Code | Description |
|---|---|
| 0 | UNASSIGNED |
| 1 | VDC_START |
| 2 | VDC_STOP |
| 12 | VDS_FAILURE |
| 13 | VDS_DETECTED |
| 14 | VDS_RECOVER |
| 15 | VDS_MAINTENANCE |
| 16 | VDS_ACTIVATE |
| 17 | VDS_MAINTENANCE_FAILED |
| 18 | VDS_ACTIVATE |
| 19 | VDS_RECOVER_FAILED |
| 123 | VDS_SLOW_STORAGE_RESPONSE_TIME |
| 493 | VDS_ALREADY_IN_REQUESTED_STATUS |
| 494 | VDS_MANUAL_FENCE_STATUS |
| 495 | VDS_MANUAL_FENCE_STATUS_FAILED |
| 530 | VDS_MANUAL_FENCE_FAILED_CALL_FENCE_SPM |
| 531 | VDS_LOW_MEM |
| 532 | VDS_HIGH_MEM_USE |
| 533 | VDS_HIGH_NETWORK_USE |
| 534 | VDS_HIGH_CPU_USE |
| 535 | VDS_HIGH_SWAP_USE |
| 536 | VDS_LOW_SWAP |
| 496 | VDS_FENCE_STATUS |
| 497 | VDS_FENCE_STATUS_FAILED |
| 498 | VDS_APPROVE |
| 499 | VDS_APPROVE_FAILED |
| 500 | VDS_FAILED_TO_RUN_VMS |
| 504 | VDS_INSTALL |
| 505 | VDS_INSTALL_FAILED |
| 506 | VDS_INITIATED_RUN_VM |
| 537 | VDS_INITIATED_RUN_VM_AS_STATELESS |
| 507 | VDS_INITIATED_RUN_VM_FAILED |
| 509 | VDS_INSTALL_IN_PROGRESS |
| 510 | VDS_INSTALL_IN_PROGRESS_WARNING |
| 511 | VDS_INSTALL_IN_PROGRESS_ERROR |
| 513 | VDS_RECOVER_FAILED_VMS_UNKNOWN |
| 514 | VDS_INITIALIZING |
| 515 | VDS_CPU_LOWER_THAN_CLUSTER |
| 516 | VDS_CPU_RETRIEVE_FAILED |
| 517 | VDS_FAILED_TO_GET_HOST_HARDWARE_INFO |
| 533 | VDS_STORAGE_CONNECTION_FAILED_BUT_LAST_VDS |
| 535 | VDS_STORAGES_CONNECTION_FAILED |
| 534 | VDS_STORAGE_VDS_STATS_FAILED |
| 517 | VDS_SET_NONOPERATIONAL |
| 518 | VDS_SET_NONOPERATIONAL_FAILED |
| 519 | VDS_SET_NONOPERATIONAL_NETWORK |
| 603 | VDS_SET_NONOPERATIONAL_IFACE_DOWN |
| 522 | VDS_SET_NONOPERATIONAL_DOMAIN |
| 523 | VDS_SET_NONOPERATIONAL_DOMAIN_FAILED |
| 524 | VDS_DOMAIN_DELAY_INTERVAL |
| 23 | VDS_LOW_DISK_SPACE |
| 24 | VDS_LOW_DISK_SPACE_ERROR |
| 600 | USER_VDS_MAINTENANCE |
| 601 | CPU_FLAGS_NX_IS_MISSING |
| 602 | USER_VDS_MAINTENANCE_MIGRATION_FAILED |
| 121 | SYSTEM_VDS_RESTART |
| 122 | SYSTEM_FAILED_VDS_RESTART |
| 604 | VDS_TIME_DRIFT_ALERT |
| 605 | PROXY_HOST_SELECTION |
| 606 | HOST_REFRESHED_CAPABILITIES |
| 607 | HOST_REFRESH_CAPABILITIES_FAILED |
| 22 | IRS_FAILURE |
| 26 | IRS_DISK_SPACE_LOW |
| 201 | IRS_DISK_SPACE_LOW_ERROR |
| 204 | IRS_HOSTED_ON_VDS |
| 30 | USER_VDC_LOGIN |
| 114 | USER_VDC_LOGIN_FAILED |
| 31 | USER_VDC_LOGOUT |
| 815 | USER_VDC_LOGOUT_FAILED |
| 150 | USER_INITIATED_RUN_VM |
| 156 | USER_INITIATED_RUN_VM_AND_PAUSE |
| 153 | USER_STARTED_VM |
| 151 | USER_INITIATED_RUN_VM_FAILED |
| 32 | USER_RUN_VM |
| 538 | USER_RUN_VM_AS_STATELESS |
| 54 | USER_FAILED_RUN_VM |
| 70 | USER_RUN_VM_AS_STATELESS_FINISHED_FAILURE |
| 171 | USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT |
| 1001 | USER_RUN_VM_FAILURE_STATELESS_SNAPSHOT_LEFT |
| 152 | USER_RUN_VM_ON_NON_DEFAULT_VDS |
| 33 | USER_STOP_VM |
| 111 | USER_STOP_SUSPENDED_VM |
| 112 | USER_STOP_SUSPENDED_VM_FAILED |
| 56 | USER_FAILED_STOP_VM |
| 34 | USER_ADD_VM |
| 37 | USER_ADD_VM_STARTED |
| 53 | USER_ADD_VM_FINISHED_SUCCESS |
| 60 | USER_ADD_VM_FINISHED_FAILURE |
| 57 | USER_FAILED_ADD_VM |
| 35 | USER_UPDATE_VM |
| 58 | USER_FAILED_UPDATE_VM |
| 250 | USER_UPDATE_VM_CLUSTER_DEFAULT_HOST_CLEARED |
| 113 | USER_REMOVE_VM_FINISHED |
| 172 | USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS |
| 149 | USER_ADD |
| 59 | USER_FAILED_REMOVE_VM |
| 38 | USER_CHANGE_DISK_VM |
| 102 | USER_FAILED_CHANGE_DISK_VM |
| 72 | USER_CHANGE_FLOPPY_VM |
| 75 | USER_FAILED_CHANGE_FLOPPY_VM |
| 39 | USER_PAUSE_VM |
| 55 | USER_FAILED_PAUSE_VM |
| 501 | USER_SUSPEND_VM |
| 512 | USER_SUSPEND_VM_FINISH_SUCCESS |
| 521 | USER_SUSPEND_VM_FINISH_FAILURE |
| 532 | USER_SUSPEND_VM_FINISH_FAILURE_WILL_TRY_AGAIN |
| 502 | USER_FAILED_SUSPEND_VM |
| 503 | USER_SUSPEND_VM_OK |
| 40 | USER_RESUME_VM |
| 103 | USER_FAILED_RESUME_VM |
| 73 | USER_INITIATED_SHUTDOWN_VM |
| 74 | USER_FAILED_SHUTDOWN_VM |
| 76 | USER_STOPPED_VM_INSTEAD_OF_SHUTDOWN |
| 77 | USER_FAILED_STOPPING_VM_INSTEAD_OF_SHUTDOWN |
| 78 | USER_ADD_DISK_TO_VM |
| 97 | USER_ADD_DISK_TO_VM_FINISHED_SUCCESS |
| 98 | USER_ADD_DISK_TO_VM_FINISHED_FAILURE |
| 79 | USER_FAILED_ADD_DISK_TO_VM |
| 80 | USER_REMOVE_DISK_FROM_VM |
| 81 | USER_FAILED_REMOVE_DISK_FROM_VM |
| 91 | USER_MOVED_VM |
| 92 | USER_MOVED_VM_FINISHED_SUCCESS |
| 83 | USER_MOVED_VM_FINISHED_FAILURE |
| 84 | USER_FAILED_MOVE_VM |
| 93 | USER_MOVED_TEMPLATE |
| 94 | USER_MOVED_TEMPLATE_FINISHED_SUCCESS |
| 85 | USER_MOVED_TEMPLATE_FINISHED_FAILURE |
| 86 | USER_FAILED_MOVE_TEMPLATE |
| 95 | USER_COPIED_TEMPLATE |
| 96 | USER_COPIED_TEMPLATE_FINISHED_SUCCESS |
| 87 | USER_COPIED_TEMPLATE_FINISHED_FAILURE |
| 88 | USER_FAILED_COPY_TEMPLATE |
| 89 | USER_UPDATE_VM_DISK |
| 2000 | USER_FAILED_UPDATE_VM_DISK |
| 2001 | USER_HOTPLUG_DISK |
| 2002 | USER_FAILED_HOTPLUG_DISK |
| 2003 | USER_HOTUNPLUG_DISK |
| 2004 | USER_FAILED_HOTUNPLUG_DISK |
| 2005 | USER_COPIED_TEMPLATE_DISK |
| 2006 | USER_COPIED_TEMPLATE_DISK_FINISHED_SUCCESS |
| 2007 | USER_COPIED_TEMPLATE_DISK_FINISHED_FAILURE |
| 2008 | USER_MOVED_VM_DISK |
| 2009 | USER_FAILED_MOVED_VM_DISK |
| 2010 | USER_MOVED_VM_DISK_FINISHED_SUCCESS |
| 2011 | USER_MOVED_VM_DISK_FINISHED_FAILURE |
| 2014 | USER_FINISHED_REMOVE_DISK |
| 2015 | USER_FINISHED_FAILED_REMOVE_DISK |
| 2016 | USER_ATTACH_DISK_TO_VM |
| 2017 | USER_FAILED_ATTACH_DISK_TO_VM |
| 2018 | USER_DETACH_DISK_FROM_VM |
| 2019 | USER_FAILED_DETACH_DISK_FROM_VM |
| 2020 | USER_ADD_DISK |
| 2021 | USER_ADD_DISK_FINISHED_SUCCESS |
| 2022 | USER_ADD_DISK_FINISHED_FAILURE |
| 2023 | USER_FAILED_ADD_DISK |
| 2024 | USER_RUN_UNLOCK_ENTITY_SCRIPT |
| 2025 | USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_SRC_IMAGE |
| 2026 | USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_DST_IMAGE |
| 3000 | USER_ADD_QUOTA |
| 3001, 3002 | USER_FAILED_ADD_QUOTA |
| 3003 | USER_FAILED_UPDATE_QUOTA |
| 3004 | USER_DELETE_QUOTA |
| 3005 | USER_FAILED_DELETE_QUOTA |
| 3006 | USER_EXCEEDED_QUOTA_VDS_GROUP_GRACE_LIMIT |
| 3007 | USER_EXCEEDED_QUOTA_VDS_GROUP_LIMIT |
| 3008 | USER_EXCEEDED_QUOTA_VDS_GROUP_THRESHOLD |
| 3009 | USER_EXCEEDED_QUOTA_STORAGE_GRACE_LIMIT |
| 3010 | USER_EXCEEDED_QUOTA_STORAGE_LIMIT |
| 3011 | USER_EXCEEDED_QUOTA_STORAGE_THRESHOLD |
| 3012 | QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION |
| 3013 | MISSING_QUOTA_STORAGE_PARAMETERS_PERMISSIVE_MODE |
| 3014 | MISSING_QUOTA_CLUSTER_PARAMETERS_PERMISSIVE_MODE |
| 4000 | GLUSTER_VOLUME_CREATE |
| 4001 | GLUSTER_VOLUME_CREATE_FAILED |
| 4002 | GLUSTER_VOLUME_OPTION_ADDED |
| 4003 | GLUSTER_VOLUME_OPTION_SET_FAILED |
| 4004 | GLUSTER_VOLUME_START |
| 4005 | GLUSTER_VOLUME_START_FAILED |
| 4006 | GLUSTER_VOLUME_STOP |
| 4007 | GLUSTER_VOLUME_STOP_FAILED |
| 4008 | GLUSTER_VOLUME_OPTIONS_RESET |
| 4009 | GLUSTER_VOLUME_OPTIONS_RESET_FAILED |
| 4010 | GLUSTER_VOLUME_DELETE |
| 4011 | GLUSTER_VOLUME_DELETE_FAILED |
| 4012 | GLUSTER_VOLUME_REBALANCE_START |
| 4013 | GLUSTER_VOLUME_REBALANCE_START_FAILED |
| 4014 | GLUSTER_VOLUME_REMOVE_BRICKS |
| 4015 | GLUSTER_VOLUME_REMOVE_BRICKS_FAILED |
| 4016 | GLUSTER_VOLUME_REPLACE_BRICK_FAILED |
| 4017 | GLUSTER_VOLUME_REPLACE_BRICK_START |
| 4018 | GLUSTER_VOLUME_REPLACE_BRICK_START_FAILED |
| 4019 | GLUSTER_VOLUME_ADD_BRICK |
| 4020 | GLUSTER_VOLUME_ADD_BRICK_FAILED |
| 4021 | GLUSTER_SERVER_REMOVE_FAILED |
| 4022 | GLUSTER_VOLUME_PROFILE_START |
| 4023 | GLUSTER_VOLUME_PROFILE_START_FAILED |
| 4024 | GLUSTER_VOLUME_PROFILE_STOP |
| 4025 | GLUSTER_VOLUME_PROFILE_STOP_FAILED |
| 4026 | GLUSTER_VOLUME_CREATED_FROM_CLI |
| 4027 | GLUSTER_VOLUME_DELETED_FROM_CLI |
| 4028 | GLUSTER_VOLUME_OPTION_SET_FROM_CLI |
| 4029 | GLUSTER_VOLUME_OPTION_RESET_FROM_CLI |
| 4030 | GLUSTER_VOLUME_PROPERTIES_CHANGED_FROM_CLI |
| 4031 | GLUSTER_VOLUME_BRICK_ADDED_FROM_CLI |
| 4032 | GLUSTER_VOLUME_BRICK_REMOVED_FROM_CLI |
| 4033 | GLUSTER_SERVER_REMOVED_FROM_CLI |
| 4034 | GLUSTER_VOLUME_INFO_FAILED |
| 4035 | GLUSTER_COMMAND_FAILED |
| 4036 | GLUSTER_SERVER_ADD_FAILED |
| 4037 | GLUSTER_SERVERS_LIST_FAILED |
| 4038 | GLUSTER_SERVER_REMOVE |
| 4039 | GLUSTER_VOLUME_STARTED_FROM_CLI |
| 4040 | GLUSTER_VOLUME_STOPPED_FROM_CLI |
| 4041 | GLUSTER_VOLUME_OPTION_CHANGED_FROM_CLI |
| 4042 | GLUSTER_HOOK_ENABLE |
| 4043 | GLUSTER_HOOK_ENABLE_FAILED |
| 4044 | GLUSTER_HOOK_ENABLE_PARTIAL |
| 4045 | GLUSTER_HOOK_DISABLE |
| 4046 | GLUSTER_HOOK_DISABLE_FAILED |
| 4047 | GLUSTER_HOOK_DISABLE_PARTIAL |
| 4048 | GLUSTER_HOOK_LIST_FAILED |
| 4049 | GLUSTER_HOOK_CONFLICT_DETECTED |
| 4050 | GLUSTER_HOOK_DETECTED_NEW |
| 4051 | GLUSTER_HOOK_DETECTED_DELETE |
| 4052 | GLUSTER_VOLUME_OPTION_MODIFIED |
| 4053 | GLUSTER_HOOK_GETCONTENT_FAILED |
| 4054 | GLUSTER_SERVICES_LIST_FAILED |
| 4055 | GLUSTER_SERVICE_TYPE_ADDED_TO_CLUSTER |
| 4056 | GLUSTER_CLUSTER_SERVICE_STATUS_CHANGED |
| 4057 | GLUSTER_SERVICE_ADDED_TO_SERVER |
| 4058 | GLUSTER_SERVER_SERVICE_STATUS_CHANGED |
| 4059 | GLUSTER_HOOK_UPDATED |
| 4060 | GLUSTER_HOOK_UPDATE_FAILED |
| 4061 | GLUSTER_HOOK_ADDED |
| 4062 | GLUSTER_HOOK_ADD_FAILED |
| 4063 | GLUSTER_HOOK_REMOVED |
| 4064 | GLUSTER_HOOK_REMOVE_FAILED |
| 4065 | GLUSTER_HOOK_REFRESH |
| 4066 | GLUSTER_HOOK_REFRESH_FAILED |
| 4067 | GLUSTER_SERVICE_STARTED |
| 4068 | GLUSTER_SERVICE_START_FAILED |
| 4069 | GLUSTER_SERVICE_STOPPED |
| 4070 | GLUSTER_SERVICE_STOP_FAILED |
| 4071 | GLUSTER_SERVICES_LIST_NOT_FETCHED |
| 4072 | GLUSTER_SERVICE_RESTARTED |
| 4073 | GLUSTER_SERVICE_RESTART_FAILED |
| 4074 | GLUSTER_VOLUME_OPTIONS_RESET_ALL |
| 4075 | GLUSTER_HOST_UUID_NOT_FOUND |
| 4076 | GLUSTER_VOLUME_BRICK_ADDED |
| 4077 | GLUSTER_CLUSTER_SERVICE_STATUS_ADDED |
| 41 | USER_VDS_RESTART |
| 107 | USER_FAILED_VDS_RESTART |
| 20 | USER_VDS_START |
| 118 | USER_FAILED_VDS_START |
| 21 | USER_VDS_STOP |
| 137 | USER_FAILED_VDS_STOP |
| 42 | USER_ADD_VDS |
| 104 | USER_FAILED_ADD_VDS |
| 43 | USER_UPDATE_VDS |
| 105 | USER_FAILED_UPDATE_VDS |
| 44 | USER_REMOVE_VDS |
| 106 | USER_FAILED_REMOVE_VDS |
| 45 | USER_CREATE_SNAPSHOT |
| 68 | USER_CREATE_SNAPSHOT_FINISHED_SUCCESS |
| 69 | USER_CREATE_SNAPSHOT_FINISHED_FAILURE |
| 170 | USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE |
| 117 | USER_FAILED_CREATE_SNAPSHOT |
| 342 | USER_REMOVE_SNAPSHOT |
| 343 | USER_FAILED_REMOVE_SNAPSHOT |
| 356 | USER_REMOVE_SNAPSHOT_FINISHED_SUCCESS |
| 357 | USER_REMOVE_SNAPSHOT_FINISHED_FAILURE |
| 46 | USER_TRY_BACK_TO_SNAPSHOT |
| 71 | USER_TRY_BACK_TO_SNAPSHOT_FINISH_SUCCESS |
| 99 | USER_TRY_BACK_TO_SNAPSHOT_FINISH_FAILURE |
| 115 | USER_FAILED_TRY_BACK_TO_SNAPSHOT |
| 47 | USER_RESTORE_FROM_SNAPSHOT |
| 1190 | USER_RESTORE_FROM_SNAPSHOT_START |
| 100 | USER_RESTORE_FROM_SNAPSHOT_FINISH_SUCCESS |
| 101 | USER_RESTORE_FROM_SNAPSHOT_FINISH_FAILURE |
| 116 | USER_FAILED_RESTORE_FROM_SNAPSHOT |
| 48 | USER_ADD_VM_TEMPLATE |
| 51 | USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS |
| 52 | USER_ADD_VM_TEMPLATE_FINISHED_FAILURE |
| 108 | USER_FAILED_ADD_VM_TEMPLATE |
| 49 | USER_UPDATE_VM_TEMPLATE |
| 109 | USER_FAILED_UPDATE_VM_TEMPLATE |
| 50 | USER_REMOVE_VM_TEMPLATE |
| 251 | USER_REMOVE_VM_TEMPLATE_FINISHED |
| 110 | USER_FAILED_REMOVE_VM_TEMPLATE |
| 135 | TEMPLATE_IMPORT |
| 136 | TEMPLATE_IMPORT_FAILED |
| 520 | USER_ATTACH_USER_TO_VM |
| 360 | USER_DETACH_USER_FROM_VM |
| 361 | USER_FAILED_DETACH_USER_FROM_VM |
| 182 | USER_FAILED_ATTACH_USER_TO_VM |
| 325 | USER_REMOVE_ADUSER |
| 326 | USER_FAILED_REMOVE_ADUSER |
| 327 | USER_FAILED_ADD_ADUSER |
| 346 | USER_PASSWORD_CHANGED |
| 347 | USER_PASSWORD_CHANGE_FAILED |
| 348 | USER_CLEAR_UNKNOWN_VMS |
| 349 | USER_FAILED_CLEAR_UNKNOWN_VMS |
| 528 | USER_EJECT_VM_DISK |
| 529 | USER_EJECT_VM_FLOPPY |
| 61 | VM_DOWN |
| 119 | VM_DOWN_ERROR |
| 62 | VM_MIGRATION_START |
| 63 | VM_MIGRATION_DONE |
| 64 | VM_MIGRATION_ABORT |
| 65 | VM_MIGRATION_FAILED |
| 66 | VM_FAILURE |
| 67 | VM_MIGRATION_START_SYSTEM_INITIATED |
| 120 | VM_MIGRATION_FAILED_FROM_TO |
| 128 | VM_MIGRATION_TRYING_RERUN |
| 161 | VM_CANCEL_MIGRATION |
| 162 | VM_CANCEL_MIGRATION_FAILED |
| 163 | VM_STATUS_RESTORED |
| 140 | VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE |
| 142 | VM_SET_TO_UNKNOWN_STATUS |
| 143 | VM_WAS_SET_DOWN_DUE_TO_HOST_REBOOT_OR_MANUAL_FENCE |
| 131 | USER_EXPORT_VM |
| 132 | USER_EXPORT_VM_FAILED |
| 133 | USER_EXPORT_TEMPLATE |
| 134 | USER_EXPORT_TEMPLATE_FAILED |
| 124 | VM_IMPORT |
| 125 | VM_IMPORT_FAILED |
| 126 | VM_NOT_RESPONDING |
| 127 | VDS_RUN_IN_NO_KVM_MODE |
| 141 | VDS_VERSION_NOT_SUPPORTED_FOR_CLUSTER |
| 129 | VM_CLEARED |
| 138 | VM_PAUSED_ENOSPC |
| 139 | VM_PAUSED_ERROR |
| 144 | VM_IMPORT_INFO |
| 145 | VM_PAUSED_EIO |
| 146 | VM_PAUSED_EPERM |
| 147 | VM_POWER_DOWN_FAILED |
| 300 | USER_ADD_VM_POOL |
| 301 | USER_ADD_VM_POOL_FAILED |
| 302 | USER_ADD_VM_POOL_WITH_VMS |
| 303 | USER_ADD_VM_POOL_WITH_VMS_FAILED |
| 320 | USER_ADD_VM_POOL_WITH_VMS_ADD_VDS_FAILED |
| 304 | USER_REMOVE_VM_POOL |
| 305 | USER_REMOVE_VM_POOL_FAILED |
| 306 | USER_ADD_VM_TO_POOL |
| 307 | USER_ADD_VM_TO_POOL_FAILED |
| 308 | USER_REMOVE_VM_FROM_POOL |
| 309 | USER_REMOVE_VM_FROM_POOL_FAILED |
| 310 | USER_ATTACH_USER_TO_POOL |
| 472 | USER_ATTACH_USER_TO_POOL_INTERNAL |
| 311 | USER_ATTACH_USER_TO_POOL_FAILED |
| 473 | USER_ATTACH_USER_TO_POOL_FAILED_INTERNAL |
| 312 | USER_DETACH_USER_FROM_POOL |
| 313 | USER_DETACH_USER_FROM_POOL_FAILED |
| 314 | USER_UPDATE_VM_POOL |
| 315 | USER_UPDATE_VM_POOL_FAILED |
| 316 | USER_ATTACH_USER_TO_VM_FROM_POOL |
| 318 | USER_ATTACH_USER_TO_VM_FROM_POOL_FINISHED_SUCCESS |
| 319 | USER_ATTACH_USER_TO_VM_FROM_POOL_FINISHED_FAILURE |
| 317 | USER_ATTACH_USER_TO_VM_FROM_POOL_FAILED |
| 344 | USER_UPDATE_VM_POOL_WITH_VMS |
| 345 | USER_UPDATE_VM_POOL_WITH_VMS_FAILED |
| 358 | USER_VM_POOL_MAX_SUBSEQUENT_FAILURES_REACHED |
| 328 | USER_ATTACH_USER_TO_TIME_LEASED_POOL |
| 329 | USER_ATTACH_USER_TO_TIME_LEASED_POOL_FAILED |
| 330 | USER_DETACH_USER_FROM_TIME_LEASED_POOL |
| 331 | USER_ATTACH_USER_FROM_TIME_LEASED_POOL_FAILED |
| 332 | USER_ATTACH_AD_GROUP_FROM_TIME_LEASED_POOL |
| 333 | USER_ATTACH_AD_GROUP_TO_TIME_LEASED_POOL_FAILED |
| 334 | USER_DETACH_AD_GROUP_FROM_TIME_LEASED_POOL |
| 335 | USER_DETACH_AD_GROUP_FROM_TIME_LEASED_POOL_FAILED |
| 336 | USER_UPDATE_USER_TO_TIME_LEASED_POOL |
| 337 | USER_UPDATE_USER_TO_TIME_LEASED_POOL_FAILED |
| 338 | USER_UPDATE_AD_GROUP_TO_TIME_LEASED_POOL |
| 337 | USER_UPDATE_AD_GROUP_TO_TIME_LEASED_POOL_FAILED |
| 338 | USER_UPDATE_AD_GROUP_TO_TIME_LEASED_POOL |
| 339 | USER_UPDATE_AD_GROUP_TO_TIME_LEASED_POOL_FAILED |
| 350 | USER_ADD_BOOKMARK |
| 351 | USER_ADD_BOOKMARK_FAILED |
| 352 | USER_UPDATE_BOOKMARK |
| 353 | USER_UPDATE_BOOKMARK_FAILED |
| 354 | USER_REMOVE_BOOKMARK |
| 355 | USER_REMOVE_BOOKMARK_FAILED |
| 400 | USER_ATTACH_VM_TO_AD_GROUP |
| 401 | USER_ATTACH_VM_TO_AD_GROUP_FAILED |
| 402 | USER_DETACH_VM_TO_AD_GROUP |
| 403 | USER_DETACH_VM_TO_AD_GROUP_FAILED |
| 404 | USER_ATTACH_VM_POOL_TO_AD_GROUP |
| 470 | USER_ATTACH_VM_POOL_TO_AD_GROUP_INTERNAL |
| 405 | USER_ATTACH_VM_POOL_TO_AD_GROUP_FAILED |
| 471 | USER_ATTACH_VM_POOL_TO_AD_GROUP_FAILED_INTERNAL |
| 406 | USER_DETACH_VM_POOL_TO_AD_GROUP |
| 407 | USER_DETACH_VM_POOL_TO_AD_GROUP_FAILED |
| 408 | USER_REMOVE_AD_GROUP |
| 409 | USER_REMOVE_AD_GROUP_FAILED |
| 430 | USER_UPDATE_TAG |
| 431 | USER_UPDATE_TAG_FAILED |
| 432 | USER_ADD_TAG |
| 433 | USER_UPDATE_TAG_FAILED |
| 434 | USER_REMOVE_TAG |
| 435 | USER_REMOVE_TAG_FAILED |
| 436 | USER_ATTACH_TAG_TO_USER |
| 437 | USER_ATTACH_TAG_TO_USER_FAILED |
| 438 | USER_ATTACH_TAG_TO_USER_GROUP |
| 439 | USER_ATTACH_TAG_TO_USER_GROUP_FAILED |
| 440 | USER_ATTACH_TAG_TO_VM |
| 441 | USER_ATTACH_TAG_TO_VM_FAILED |
| 442 | USER_ATTACH_TAG_TO_VDS |
| 443 | USER_ATTACH_TAG_TO_VDS_FAILED |
| 444 | USER_DETACH_VDS_FROM_TAG |
| 445 | USER_DETACH_VDS_FROM_TAG_FAILED |
| 446 | USER_DETACH_VM_FROM_TAG |
| 447 | USER_DETACH_VM_FROM_TAG_FAILED |
| 448 | USER_DETACH_USER_FROM_TAG |
| 449 | USER_DETACH_USER_FROM_TAG_FAILED |
| 450 | USER_DETACH_USER_GROUP_FROM_TAG |
| 451 | USER_DETACH_USER_GROUP_FROM_TAG_FAILED |
| 452 | USER_ATTACH_TAG_TO_USER_EXISTS |
| 453 | USER_ATTACH_TAG_TO_USER_GROUP_EXISTS |
| 454 | USER_ATTACH_TAG_TO_VM_EXISTS |
| 455 | USER_ATTACH_TAG_TO_VDS_EXISTS |
| 555 | USER_MOVE_TAG |
| 556 | USER_MOVE_TAG_FAILED |
| 456 | USER_LOGGED_IN_VM |
| 457 | USER_LOGGED_OUT_VM |
| 458 | USER_LOCKED_VM |
| 459 | USER_UNLOCKED_VM |
| 460 | USER_DETACH_USER_FROM_TIME_LEASED_POOL_INTERNAL |
| 461 | USER_DETACH_USER_FROM_TIME_LEASED_POOL_FAILED_INTERNAL |
| 462 | USER_DETACH_AD_GROUP_FROM_TIME_LEASED_POOL_INTERNAL |
| 463 | USER_DETACH_AD_GROUP_FROM_TIME_LEASED_POOL_FAILED_INTERNAL |
| 467 | UPDATE_TAGS_VM_DEFAULT_DISPLAY_TYPE |
| 468 | UPDATE_TAGS_VM_DEFAULT_DISPLAY_TYPE_FAILED |
| 809 | USER_ADD_VDS_GROUP |
| 810 | USER_ADD_VDS_GROUP_FAILED |
| 811 | USER_UPDATE_VDS_GROUP |
| 812 | USER_UPDATE_VDS_GROUP_FAILED |
| 835 | SYSTEM_UPDATE_VDS_GROUP |
| 836 | SYSTEM_UPDATE_VDS_GROUP_FAILED |
| 813 | USER_REMOVE_VDS_GROUP |
| 814 | USER_REMOVE_VDS_GROUP_FAILED |
| 816 | MAC_POOL_EMPTY |
| 833 | MAC_ADDRESS_IS_IN_USE |
| 838 | MAC_ADDRESS_IS_IN_USE_UNPLUG |
| 817 | CERTIFICATE_FILE_NOT_FOUND |
| 818 | RUN_VM_FAILED |
| 837 | MAC_ADDRESSES_POOL_NOT_INITIALIZED |
| 819 | VDS_REGISTER_ERROR_UPDATING_HOST |
| 820 | VDS_REGISTER_ERROR_UPDATING_HOST_ALL_TAKEN |
| 821 | VDS_REGISTER_HOST_IS_ACTIVE |
| 822 | VDS_REGISTER_ERROR_UPDATING_NAME |
| 823 | VDS_REGISTER_ERROR_UPDATING_NAMES_ALL_TAKEN |
| 824 | VDS_REGISTER_NAME_IS_ACTIVE |
| 825 | VDS_REGISTER_AUTO_APPROVE_PATTERN |
| 826 | VDS_REGISTER_FAILED |
| 827 | VDS_REGISTER_EXISTING_VDS_UPDATE_FAILED |
| 828 | VDS_REGISTER_SUCCEEDED |
| 834 | VDS_REGISTER_EMPTY_ID |
| 829 | VM_MIGRATION_ON_CONNECT_CHECK_FAILED |
| 830 | VM_MIGRATION_ON_CONNECT_CHECK_SUCCEEDED |
| 920 | NETWORK_ATTACH_NETWORK_TO_VDS |
| 921 | NETWORK_ATTACH_NETWORK_TO_VDS_FAILED |
| 922 | NETWORK_DETACH_NETWORK_FROM_VDS |
| 923 | NETWORK_DETACH_NETWORK_FROM_VDS_FAILED |
| 924 | NETWORK_ADD_BOND |
| 925 | NETWORK_ADD_BOND_FAILED |
| 926 | NETWORK_REMOVE_BOND |
| 927 | NETWORK_REMOVE_BOND_FAILED |
| 928 | NETWORK_VDS_NETWORK_MATCH_CLUSTER |
| 929 | NETWORK_VDS_NETWORK_NOT_MATCH_CLUSTER |
| 930 | NETWORK_REMOVE_VM_INTERFACE |
| 931 | NETWORK_REMOVE_VM_INTERFACE_FAILED |
| 932 | NETWORK_ADD_VM_INTERFACE |
| 933 | NETWORK_ADD_VM_INTERFACE_FAILED |
| 934 | NETWORK_UPDATE_VM_INTERFACE |
| 935 | NETWORK_UPDATE_VM_INTERFACE_FAILED |
| 936 | NETWORK_ADD_TEMPLATE_INTERFACE |
| 937 | NETWORK_ADD_TEMPLATE_INTERFACE_FAILED |
| 938 | NETWORK_REMOVE_TEMPLATE_INTERFACE |
| 939 | NETWORK_REMOVE_TEMPLATE_INTERFACE_FAILED |
| 940 | NETWORK_UPDATE_TEMPLATE_INTERFACE |
| 941 | NETWORK_UPDATE_TEMPLATE_INTERFACE_FAILED |
| 942 | NETWORK_ADD_NETWORK |
| 943 | NETWORK_ADD_NETWORK_FAILED |
| 944 | NETWORK_REMOVE_NETWORK |
| 945 | NETWORK_REMOVE_NETWORK_FAILED |
| 946 | NETWORK_ATTACH_NETWORK_TO_VDS_GROUP |
| 947 | NETWORK_ATTACH_NETWORK_TO_VDS_GROUP_FAILED |
| 948 | NETWORK_DETACH_NETWORK_TO_VDS_GROUP |
| 949 | NETWORK_DETACH_NETWORK_TO_VDS_GROUP_FAILED |
| 1102 | NETWORK_ACTIVATE_VM_INTERFACE_SUCCESS |
| 1103 | NETWORK_ACTIVATE_VM_INTERFACE_FAILURE |
| 1104 | NETWORK_DEACTIVATE_VM_INTERFACE_SUCCESS |
| 1105 | NETWORK_DEACTIVATE_VM_INTERFACE_FAILURE |
| 1100 | NETWORK_UPDATE_DISPLAY_TO_VDS_GROUP |
| 1101 | NETWORK_UPDATE_DISPLAY_TO_VDS_GROUP_FAILED |
| 1102 | NETWORK_UPDATE_NETWORK_TO_VDS_INTERFACE |
| 1103 | NETWORK_UPDATE_NETWORK_TO_VDS_INTERFACE_FAILED |
| 1104 | NETWORK_COMMINT_NETWORK_CHANGES |
| 1105 | NETWORK_COMMINT_NETWORK_CHANGES_FAILED |
| 1106 | NETWORK_HOST_USING_WRONG_CLUSER_VLAN |
| 1107 | NETWORK_HOST_MISSING_CLUSER_VLAN |
| 1108 | VDS_NETWORK_MTU_DIFFER_FROM_LOGICAL_NETWORK |
| 1109 | BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES |
| 1110 | VDS_NETWORKS_OUT_OF_SYNC |
| 1112 | NETWORK_UPDTAE_NETWORK_ON_CLUSTER |
| 1113 | NETWORK_UPDTAE_NETWORK_ON_CLUSTER_FAILED |
| 1114 | NETWORK_UPDATE_NETWORK |
| 1115 | NETWORK_UPDATE_NETWORK_FAILED |
| 1116 | NETWORK_UPDATE_VM_INTERFACE_LINK_UP |
| 1117 | NETWORK_UPDATE_VM_INTERFACE_LINK_DOWN |
| 1118 | INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION |
| 1119 | VLAN_ID_MISMATCH_FOR_MANAGEMENT_NETWORK_CONFIGURATION |
| 1120 | SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION |
| 1121 | PERSIST_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK |
| 1162 | IMPORTEXPORT_STARTING_EXPORT_VM |
| 1150 | IMPORTEXPORT_EXPORT_VM |
| 1151 | IMPORTEXPORT_EXPORT_VM_FAILED |
| 1165 | IMPORTEXPORT_STARTING_IMPORT_VM |
| 1152 | IMPORTEXPORT_IMPORT_VM |
| 1153 | IMPORTEXPORT_IMPORT_VM_FAILED |
| 1166 | IMPORTEXPORT_STARTING_REMOVE_TEMPLATE |
| 1154 | IMPORTEXPORT_REMOVE_TEMPLATE |
| 1155 | IMPORTEXPORT_REMOVE_TEMPLATE_FAILED |
| 1156 | IMPORTEXPORT_EXPORT_TEMPLATE |
| 1164 | IMPORTEXPORT_STARTING_EXPORT_TEMPLATE |
| 1157 | IMPORTEXPORT_EXPORT_TEMPLATE_FAILED |
| 1163 | IMPORTEXPORT_STARTING_IMPORT_TEMPLATE |
| 1158 | IMPORTEXPORT_IMPORT_TEMPLATE |
| 1159 | IMPORTEXPORT_IMPORT_TEMPLATE_FAILED |
| 1167 | IMPORTEXPORT_STARTING_REMOVE_VM |
| 1160 | IMPORTEXPORT_REMOVE_VM |
| 1161 | IMPORTEXPORT_REMOVE_VM_FAILED |
| 1162 | IMPORTEXPORT_GET_VMS_INFO_FAILED |
| 1168 | IMPORTEXPORT_FAILED_TO_IMPORT_VM |
| 1169 | IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE |
| 1170 | IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES |
| 850 | USER_ADD_PERMISSION |
| 851 | USER_ADD_PERMISSION_FAILED |
| 852 | USER_REMOVE_PERMISSION |
| 853 | USER_REMOVE_PERMISSION_FAILED |
| 854 | USER_ADD_ROLE |
| 855 | USER_ADD_ROLE_FAILED |
| 856 | USER_UPDATE_ROLE |
| 857 | USER_UPDATE_ROLE_FAILED |
| 858 | USER_REMOVE_ROLE859 |
| 859 | USER_REMOVE_ROLE_FAILED |
| 860 | USER_ATTACHED_ACTION_GROUP_TO_ROLE |
| 861 | USER_ATTACHED_ACTION_GROUP_TO_ROLE_FAILED |
| 962 | USER_DETACHED_ACTION_GROUP_FROM_ROLE |
| 863 | USER_DETACHED_ACTION_GROUP_FROM_ROLE_FAILED |
| 864 | USER_ADD_ROLE_WITH_ACTION_GROUP |
| 865 | USER_ADD_ROLE_WITH_ACTION_GROUP_FAILED |
| 900 | AD_COMPUTER_ACCOUNT_SUCCEEDED |
| 901 | AD_COMPUTER_ACCOUNT_FAILED |
| 950 | USER_ADD_STORAGE_POOL |
| 951 | USER_ADD_STORAGE_POOL_FAILED |
| 952 | USER_UPDATE_STORAGE_POOL |
| 953 | USER_UPDATE_STORAGE_POOL_FAILED |
| 954 | USER_REMOVE_STORAGE_POOL |
| 955 | USER_REMOVE_STORAGE_POOL_FAILED |
| 918 | USER_FORCE_REMOVE_STORAGE_POOL |
| 919 | USER_FORCE_REMOVE_STORAGE_POOL_FAILED |
| 956 | USER_ADD_STORAGE_DOMAIN |
| 957 | USER_ADD_STORAGE_DOMAIN_FAILED |
| 958 | USER_UPDATE_STORAGE_DOMAIN |
| 959 | USER_UPDATE_STORAGE_DOMAIN_FAILED |
| 960 | USER_REMOVE_STORAGE_DOMAIN |
| 961 | USER_REMOVE_STORAGE_DOMAIN_FAILED |
| 962 | USER_ATTACH_STORAGE_DOMAIN_TO_POOL |
| 963 | USER_ATTACH_STORAGE_DOMAIN_TO_POOL_FAILED |
| 964 | USER_DETACH_STORAGE_DOMAIN_FROM_POOL |
| 965 | USER_DETACH_STORAGE_DOMAIN_FROM_POOL_FAILED |
| 966 | USER_ACTIVATED_STORAGE_DOMAIN |
| 967 | USER_ACTIVATE_STORAGE_DOMAIN_FAILED |
| 968 | USER_DEACTIVATED_STORAGE_DOMAIN |
| 969 | USER_DEACTIVATE_STORAGE_DOMAIN_FAILED |
| 970 | SYSTEM_DEACTIVATED_STORAGE_DOMAIN |
| 971 | SYSTEM_DEACTIVATE_STORAGE_DOMAIN_FAILED |
| 972 | USER_EXTENDED_STORAGE_DOMAIN |
| 973 | USER_EXTENDED_STORAGE_DOMAIN_FAILED |
| 974 | USER_REMOVE_VG |
| 975 | USER_REMOVE_VG_FAILED |
| 976 | USER_ACTIVATE_STORAGE_POOL |
| 977 | USER_ACTIVATE_STORAGE_POOL_FAILED |
| 978 | SYSTEM_FAILED_CHANGE_STORAGE_POOL_STATUS |
| 979 | SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM |
| 980 | SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC |
| 981 | USER_FORCE_REMOVE_STORAGE_DOMAIN |
| 982 | USER_FORCE_REMOVE_STORAGE_DOMAIN_FAILED |
| 983 | RECONSTRUCT_MASTER_FAILED_NO_MASTER |
| 984 | RECONSTRUCT_MASTER_DONE |
| 985 | RECONSTRUCT_MASTER_FAILED |
| 986 | SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_SEARCHING_NEW_SPM |
| 987 | SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_WITH_ERROR |
| 988 | USER_CONNECT_HOSTS_TO_LUN_FAILED |
| 989 | SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_FROM_NON_OPERATIONAL |
| 990 | SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC |
| 991 | RECOVERY_STORAGE_POOL |
| 992 | RECOVERY_STORAGE_POOL_FAILED |
| 993 | SYSTEM_CHANGE_STORAGE_POOL_STATUS_RESET_IRS |
| 994 | CONNECT_STORAGE_SERVERS_FAILED |
| 995 | CONNECT_STORAGE_POOL_FAILED |
| 996 | STORAGE_DOMAIN_ERROR |
| 997 | REFRESH_REPOSITORY_FILE_LIST_FAILED |
| 998 | REFRESH_REPOSITORY_FILE_LIST_SUCCEEDED |
| 999 | STORAGE_ALERT_VG_METADATA_CRITICALLY_FULL |
| 1000 | STORAGE_ALERT_SMALL_VG_METADATA |
| 1002 | USER_ATTACH_STORAGE_DOMAINS_TO_POOL |
| 1003 | USER_ATTACH_STORAGE_DOMAINS_TO_POOL_FAILED |
| 1004 | STORAGE_DOMAIN_TASKS_ERROR |
| 1005 | UPDATE_OVF_FOR_STORAGE_POOL_FAILED |
| 1006 | UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS |
| 1010 | RELOAD_CONFIGURATIONS_SUCCESS |
| 1101 | RELOAD_CONFIGURATIONS_FAILURE |
| 1100 | USER_ACCOUNT_DISABLED_OR_LOCKED |
| 1101 | USER_ACCOUNT_PASSWORD_EXPIRED |
| 1150 | PROVIDER_ADDED |
| 1151 | PROVIDER_ADDITION_FAILED |
| 1152 | PROVIDER_UPDATED |
| 1153 | PROVIDER_UPDATE_FAILED |
| 1154 | PROVIDER_REMOVED |
| 1155 | PROVIDER_REMOVAL_FAILED |
| 1156 | PROVIDER_CERTIFICATE_CHAIN_IMPORTED |
| 1157 | PROVIDER_CERTIFICATE_CHAIN_IMPORT_FAILED |
| 1200 | ENTITY_RENAMED |
| 9000 | VDS_ALERT_FENCE_IS_NOT_CONFIGURED |
| 9001 | VDS_ALERT_FENCE_TEST_FAILED |
| 9002 | VDS_ALERT_FENCE_OPERATION_FAILED |
| 9003 | VDS_ALERT_FENCE_OPERATION_SKIPPED |
| 9004 | VDS_ALERT_FENCE_NO_PROXY_HOST |
| 9005 | VDS_ALERT_FENCE_STATUS_VERIFICATION_FAILED |
| 9006 | CANNOT_HIBERNATE_RUNNING_VMS_AFTER_CLUSTER_CPU_UPGRADE |
| 9007 | VDS_ALERT_SECONDARY_AGENT_USED_FOR_FENCE_OPERATION |
| 9500 | TASK_STOPPING_ASYNC_TASK |
| 9501 | TASK_CLEARING_ASYNC_TASK |
| 9502 | VDS_ACTIVATE_ASYNC |
| 9503 | VDS_ACTIVATE_FAILED_ASYNC |
| 9504 | STORAGE_ACTIVATE_ASYNC |
| 9505 | USER_ACTIVATED_STORAGE_DOMAIN_ASYNC |
| 9506 | USER_ACTIVATE_STORAGE_DOMAIN_FAILED_ASYNC |
| 9600 | IMPORTEXPORT_IMPORT_VM_INVALID_INTERFACES |
| 9601 | VDS_SET_NON_OPERATIONAL_VM_NETWORK_IS_BRIDGELESS |
| 9604 | EMULATED_MACHINES_INCOMPATIBLE_WITH_CLUSTER |
| 9602 | HA_VM_FAILED |
| 9603 | HA_VM_RESTART_FAILED |
| 9701 | DWH_STOPPED |
| 9700 | DWH_STARTED |
| 9704 | DWH_ERROR |
| 9801 | EXTERNAL_EVENT_NORMAL |
| 9802 | EXTERNAL_EVENT_WARNING |
| 9803 | EXTERNAL_EVENT_ERROR |
| 9804 | EXTERNAL_ALERT |
| 9901 | WATCHDOG_EVENT |
| 10000 | VDS_UNTRUSTED |
Appendix D. Java Keystores Copy linkLink copied to clipboard!
Procedure D.1. Import a certificate into a new Java keystore
rhsc.cer certificate from Section 2.1, “TLS/SSL Certification” into a Java keystore. This procedure requires the keytool management utility from the Java Development Kit (JDK) available for Linux and Windows systems.
- Access your client machine and locate the
rhsc.cercertificate. - Import the
rhsc.cercertificate using the Java keytool management utility.keytool -importcert -v -trustcacerts -keystore restapi.jks -noprompt -alias rhsc -file rhsc.cer
keytool -importcert -v -trustcacerts -keystore restapi.jks -noprompt -alias rhsc -file rhsc.cerCopy to Clipboard Copied! Toggle word wrap Toggle overflow The keytool utility creates a new keystore file namedrestapi.jks. - keytool asks for the keystore password. Enter a password and keytool asks to verify it.
- keytool adds the
rhsc.cercertificate to therestapi.jkskeystore. Use keytool -list command to view the certificate's entry in the keystore:keytool -list -keystore restapi.jks -storepass [password]
keytool -list -keystore restapi.jks -storepass [password]Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Important
openssl x509 -in rhsc.cer -out rhsc.new -outform [pem|der]
openssl x509 -in rhsc.cer -out rhsc.new -outform [pem|der]
rhsc.new to use in place of rhsc.cer.
Appendix E. Certificates Copy linkLink copied to clipboard!
E.1. Creating SSL/TLS Certificates Copy linkLink copied to clipboard!
SSL/TLS certificates provide a layer of security for accessing your installation over HTTPS. This procedure provides instructions for creating certificates and configuring your server with them.
openssl. To install this tool, run the following command on your server:
#yum install openssl
#yum install openssl
Procedure E.1. Creating a Certificate Authority
- Run the following command:
#openssl req -new -x509 -keyout ca.key -out ca.crt -days 3650
#openssl req -new -x509 -keyout ca.key -out ca.crt -days 3650Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command requests a new CA pair valid for 3650 days. - Enter a password to protect your CA:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enter the following details about your organization:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This information forms the Distinguished Name (DN) in your certificate.
You have created a Certificate Authority. openssl creates two files: ca.key, which is a key that administrators use to sign certificates, and ca.crt, which is the public CA certificate that users obtain to verify the validity of signed certificates they receive. Make sure users accessing your server have a copy of ca.crt so that they can import it into their client's trusted CA store.
E.2. Creating an SSL Certificate Copy linkLink copied to clipboard!
The following procedure creates an SSL certificate and signs it with the CA key. SSL/TLS certificates provide a layer of security for accessing your installation over HTTPS. This procedure provides instructions for creating certificates and configuring the server with them.
openssl. To install this tool, run the following command on your server:
#yum install openssl
#yum install openssl
Procedure E.2. Creating an SSL Certificate
- Create a key for your server:
#openssl genrsa -out ssl.key
#openssl genrsa -out ssl.keyCopy to Clipboard Copied! Toggle word wrap Toggle overflow This creates anssl.keyfile. - Use the key to create a signing request for your certificate:
#openssl req -new -key ssl.key -out ssl.csr
#openssl req -new -key ssl.key -out ssl.csrCopy to Clipboard Copied! Toggle word wrap Toggle overflow The signing request asks for some organization details to form the Distinguished Name (DN) in your certificate.Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates anssl.csrsigning request file. - Create the signed SSL certificate:
Create the signed SSL certificate:
Create the signed SSL certificate:Copy to Clipboard Copied! Toggle word wrap Toggle overflow opensslasks for your CA key's password.This creates a certificate file namedssl.crt.
Important
Procedure E.3. Resolving this error
- Create the index.txt file.
#touch /etc/pki/CA/index.txt
#touch /etc/pki/CA/index.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a serial file to label the CA and all subsequent certificates.
#echo '1000' > /etc/pki/CA/serial
#echo '1000' > /etc/pki/CA/serialCopy to Clipboard Copied! Toggle word wrap Toggle overflow
#openssl ca -cert ca.crt -keyfile ca.key -out ssl.crt -infiles ssl.csr
#openssl ca -cert ca.crt -keyfile ca.key -out ssl.crt -infiles ssl.csr
ssl.crt and ssl.key form the certificate pair that your server uses to encrypt data via HTTPS.
You have created an SSL certificate and signed it with the CA key. openssl creates two files: ca.key, which is a key that administrators use to sign certificates, and ca.crt, which is the public CA certificate that users obtain to verify the validity of signed certificates they receive. Make sure users accessing your server have a copy of the ca.crt so that they can import it into their client's trusted CA store.
E.3. Configuring HTTPS Communication Copy linkLink copied to clipboard!
Configure HTTPS to use the SSL certificate key on your system.
Procedure E.4. Configuring HTTPS Communication
- Edit the
/etc/httpd/conf.d/ssl.conffile and modify the following settings:SSLCertificateFile [location of your ssl.crt] SSLCertificateKeyFile [location of your ssl.key]
SSLCertificateFile [location of your ssl.crt] SSLCertificateKeyFile [location of your ssl.key]Copy to Clipboard Copied! Toggle word wrap Toggle overflow - After editing these settings, restart your web server:
#service httpd restart
#service httpd restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow
You have configured HTTPS to use the SSL certificate key on your system.
E.4. Network Security Services (NSS) Database Copy linkLink copied to clipboard!
cURL, use NSS to verify trusted SSL communication. This process helps a user import the rhsc.cer certificate into the local NSS database.
rhsc.cer certificate using the following command:
$certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "zz Console" -i rhsc.cer
$certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "zz Console" -i rhsc.cer
rhsc.cer certificate as root using the following command:
#certutil -d sql:/etc/pki/nssdb -A -t TC -n "Red Hat Gluster Storage Console" -i rhsc.cer
#certutil -d sql:/etc/pki/nssdb -A -t TC -n "Red Hat Gluster Storage Console" -i rhsc.cer
E.5. Java Keystores Copy linkLink copied to clipboard!
keytool management utility from the Java Development Kit (JDK) available for Linux and Windows systems.
Procedure E.5. Import a Certificate into a New Java Keystore
- Access your client machine and locate the
rhsc.cercertificate. - Import the
rhsc.cercertificate using the Javakeytoolmanagement utility.keytool -importcert -v -trustcacerts -keystore restapi.jks -noprompt -alias rhsc -file rhsc.cer
keytool -importcert -v -trustcacerts -keystore restapi.jks -noprompt -alias rhsc -file rhsc.cerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Thekeytoolutility creates a new keystore file namedrestapi.jks. keytoolasks for thekeystorepassword. Enter a password andkeytoolasks to verify it.keytooladds therhsc.cercertificate to the restapi.jks keystore. Usekeytool -listcommand to view the certificate's entry in the keystore:keytool -list -keystore restapi.jks -storepass [password]
keytool -list -keystore restapi.jks -storepass [password]Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Important
keytool parse the certificate incorrectly. If keytool does not recognize the certificate, convert it to a different X.509 format with the openssl tool:
openssl x509 -in rhsc.cer -out rhsc.new -outform [pem|der]
openssl x509 -in rhsc.cer -out rhsc.new -outform [pem|der]
Appendix F. Revision History Copy linkLink copied to clipboard!
| Revision History | |||
|---|---|---|---|
| Revision 3.1-2 | Wed July 29 2015 | ||
| |||
| Revision 3-1-1 | Wed Jul 29 2015 | ||
| |||
| Revision 3.1-0 | Tue July 28 2015 | ||
| |||


