Create chassis from dictionaries.
Parameters: |
|
---|---|
Returns: | array of exceptions encountered during creation. |
Create nodes from dictionaries.
Parameters: |
|
---|---|
Returns: | array of exceptions encountered during creation. |
Create ports from dictionaries.
Parameters: |
|
---|---|
Returns: | array of exceptions encountered during creation. |
Create resources using their JSON or YAML descriptions.
Parameters: |
|
---|---|
Raises: | ClientException if any operation during files processing/resource creation fails. |
Call the client to create a chassis.
Parameters: |
|
---|---|
Returns: | UUID of the created chassis or None in case of exception, and an exception, if it appears. |
Raises: | InvalidAttribute, if some parameters passed to client’s create_method are invalid. |
Raises: | ClientException, if the creation of the chassis fails. |
Catch errors of the creation of a single resource.
This decorator appends an error (which is an instance of some client exception class) to the return value of the create_method, changing the return value from just UUID to (UUID, error), and does some exception handling.
Parameters: | resource_type – string value, the type of the resource being created, e.g. ‘node’, used purely for exception messages. |
---|
Call the client to create a node.
Parameters: |
|
---|---|
Returns: | UUID of the created node or None in case of exception, and an exception, if it appears. |
Raises: | InvalidAttribute, if some parameters passed to client’s create_method are invalid. |
Raises: | ClientException, if the creation of the node fails. |
Call the client to create a port.
Parameters: |
|
---|---|
Returns: | UUID of the created port or None in case of exception, and an exception, if it appears. |
Raises: | InvalidAttribute, if some parameters passed to client’s create_method are invalid. |
Raises: | ClientException, if the creation of the port fails. |
Deserialize JSON or YAML from file.
Parameters: | filename – name of the file containing JSON or YAML. |
---|---|
Returns: | a dictionary deserialized from JSON or YAML. |
Raises: | ClientException if the file can not be loaded or if its contents is not a valid JSON or YAML, or if the file extension is not supported. |