Package cm_api :: Package endpoints :: Module types :: Class ApiCommand
[hide private]
[frames] | no frames]

Class ApiCommand

source code

   object --+    
            |    
BaseApiObject --+
                |
               ApiCommand
Known Subclasses:

Instance Methods [hide private]
 
__str__(self)
Default implementation of __str__.
source code
 
_path(self) source code
 
fetch(self)
Retrieve updated data about the command from the server.
source code
 
wait(self, timeout=None)
Wait for command to finish.
source code
 
abort(self)
Abort a running command.
source code
 
retry(self)
Retry a failed or aborted command.
source code

Inherited from BaseApiObject: __init__, __setattr__, to_json_dict

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
_get_attributes(cls)
Returns a map of property names to attr instances (or None for default attribute behavior) describing the properties of the object.
source code

Inherited from BaseApiObject: from_json_dict

Static Methods [hide private]

Inherited from BaseApiObject: init

Class Variables [hide private]
  SYNCHRONOUS_COMMAND_ID = -1

Inherited from BaseApiObject (private): _ATTRIBUTES, _WHITELIST

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_get_attributes(cls)
Class Method

source code 

Returns a map of property names to attr instances (or None for default attribute behavior) describing the properties of the object.

By default, this method will return the class's _ATTRIBUTES field. Classes can override this method to do custom initialization of the attributes when needed.

Overrides: BaseApiObject._get_attributes
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Default implementation of __str__. Uses the type name and the first attribute retrieved from the attribute map to create the string.

Overrides: object.__str__
(inherited documentation)

fetch(self)

source code 

Retrieve updated data about the command from the server.

Returns:
A new ApiCommand object.

wait(self, timeout=None)

source code 

Wait for command to finish.

Parameters:
  • timeout - (Optional) Max amount of time (in seconds) to wait. Wait forever by default.
Returns:
The final ApiCommand object, containing the last known state. The command may still be running in case of timeout.

abort(self)

source code 

Abort a running command.

Returns:
A new ApiCommand object with the updated information.

retry(self)

source code 

Retry a failed or aborted command.

Returns:
A new ApiCommand object with the updated information.