diff --git a/openstack/compute/v2/extension.py b/openstack/compute/v2/extension.py index d74482e0..85ad9bfd 100644 --- a/openstack/compute/v2/extension.py +++ b/openstack/compute/v2/extension.py @@ -24,9 +24,16 @@ class Extension(resource.Resource): allow_list = True # Properties + #: A short name by which this extension is also known. alias = resource.prop('alias') + #: Text describing this extension's purpose. description = resource.prop('description') + #: Links pertaining to this extension. This is a list of dictionaries, + #: each including keys ``href`` and ``rel``. links = resource.prop('links') + #: The name of the extension. name = resource.prop('name') + #: A URL pointing to the namespace for this extension. namespace = resource.prop('namespace') + # Timestamp when this extension was last updated. updated = resource.prop('updated') diff --git a/openstack/compute/v2/flavor.py b/openstack/compute/v2/flavor.py index fb8ea9c2..3388ec20 100644 --- a/openstack/compute/v2/flavor.py +++ b/openstack/compute/v2/flavor.py @@ -28,9 +28,17 @@ class Flavor(resource.Resource): allow_list = True # Properties + #: Size of the disk this flavor offers. *Type: int* disk = resource.prop('disk', type=int) + #: ``True`` if this is a publicly visible flavor. ``False`` if this is + #: a private image. *Type: bool* is_public = resource.prop('os-flavor-access:is_public', type=bool) + #: Links pertaining to this flavor. This is a list of dictionaries, + #: each including keys ``href`` and ``rel``. links = resource.prop('links') + #: The name of this flavor. name = resource.prop('name') + #: The amount of RAM (in MB) this flavor offers. *Type: int* ram = resource.prop('ram', type=int) + #: The number of virtual CPUs this flavor offers. *Type: int* vcpus = resource.prop('vcpus', type=int) diff --git a/openstack/compute/v2/image.py b/openstack/compute/v2/image.py index 690f6cad..16e42eac 100644 --- a/openstack/compute/v2/image.py +++ b/openstack/compute/v2/image.py @@ -28,12 +28,23 @@ class Image(resource.Resource): allow_list = True # Properties + #: Timestamp when the image was created. created = resource.prop('created') + #: Links pertaining to this image. This is a list of dictionaries, + #: each including keys ``href`` and ``rel``, and optionally ``type``. links = resource.prop('links') + #: Metadata pertaining to this image. *Type: dict* metadata = resource.prop('metadata', type=dict) + #: The mimimum disk size. *Type: int* min_disk = resource.prop('minDisk', type=int) + #: The minimum RAM size. *Type: int* min_ram = resource.prop('minRam', type=int) + #: The name of this image. name = resource.prop('name') + #: If this image is still building, its progress is represented here. + #: Once an image is created, progres will be 100. *Type: int* progress = resource.prop('progress', type=int) + #: The status of this image. status = resource.prop('status') + #: Timestamp when the image was updated. updated = resource.prop('updated') diff --git a/openstack/compute/v2/keypair.py b/openstack/compute/v2/keypair.py index d8211bf5..1cde3d33 100644 --- a/openstack/compute/v2/keypair.py +++ b/openstack/compute/v2/keypair.py @@ -31,9 +31,14 @@ class Keypair(resource.Resource): allow_list = True # Properties + #: The short fingerprint associated with the ``public_key`` for + #: this keypair. fingerprint = resource.prop('fingerprint') + #: A name identifying the keypair name = resource.prop('name') + #: The private key for the keypair private_key = resource.prop('private_key') + #: The SSH public key that is paired with the server. public_key = resource.prop('public_key') def __init__(self, attrs=None, loaded=False): diff --git a/openstack/compute/v2/server.py b/openstack/compute/v2/server.py index 0162b6a0..7273788c 100644 --- a/openstack/compute/v2/server.py +++ b/openstack/compute/v2/server.py @@ -35,18 +35,47 @@ class Server(resource.Resource): # Properties access_ipv4 = resource.prop('accessIPv4') access_ipv6 = resource.prop('accessIPv6') + #: A dictionary of addresses this server can be accessed through. + #: The dictionary contains keys such as ``private`` and ``public``, + #: each containing a list of dictionaries for addresses of that type. + #: The addresses are contained in a dictionary with keys ``addr`` + #: and ``version``, which is either 4 or 6 depending on the protocol + #: of the IP address. *Type: dict* addresses = resource.prop('addresses', type=dict) + #: Timestamp of when the server was created. created = resource.prop('created') - flavor = resource.prop('flavorRef', alias='flavor') + #: A dictionary with details on the flavor this server is running. + #: The dictionary includes a key for the ``id`` of the flavor, as well + #: as a ``links`` key, which includes a list of relevant links for this + #: flavor. *Type: dict* + flavor = resource.prop('flavorRef', alias='flavor', type=dict) + #: An ID representing the host of this server. host_id = resource.prop('hostId') - image = resource.prop('imageRef', alias='image') + #: A dictionary with details on the image this server is running. + #: The dictionary includes a key for ``id`` of the image, as well + #: as a ``links`` key, which includes a list of relevant links for this + #: image. *Type: dict* + image = resource.prop('imageRef', alias='image', type=dict) + #: A list of dictionaries holding links relevant to this server. links = resource.prop('links') - metadata = resource.prop('metadata') + #: Metadata stored for this server. *Type: dict* + metadata = resource.prop('metadata', type=dict) + #: The name of this server. name = resource.prop('name') + #: While the server is building, this value represents the percentage + #: of completion. Once it is completed, it will be 100. *Type: int* progress = resource.prop('progress', type=int) + #: The project this server is associated with. project_id = resource.prop('tenant_id') + #: The state this server is in. Valid values include ``ACTIVE``, + #: ``BUILDING``, ``DELETED``, ``ERROR``, ``HARD_REBOOT``, ``PASSWORD``, + #: ``PAUSED``, ``REBOOT``, ``REBUILD``, ``RESCUED``, ``RESIZED``, + #: ``REVERT_RESIZE``, ``SHUTOFF``, ``SOFT_DELETED``, ``STOPPED``, + #: ``SUSPENDED``, ``UNKNOWN``, or ``VERIFY_RESIZE``. status = resource.prop('status') + #: Timestamp of when this server was last updated. updated = resource.prop('updated') + #: The user ID associated with this server. user_id = resource.prop('user_id') def ips(self, session): diff --git a/openstack/compute/v2/server_interface.py b/openstack/compute/v2/server_interface.py index e9a5f16c..a08d5cc2 100644 --- a/openstack/compute/v2/server_interface.py +++ b/openstack/compute/v2/server_interface.py @@ -29,9 +29,15 @@ class ServerInterface(resource.Resource): allow_list = True # Properties + #: Fixed IP addresses with subnet IDs. fixed_ips = resource.prop('fixed_ips') + #: The MAC address. mac_addr = resource.prop('mac_addr') + #: The network ID. net_id = resource.prop('net_id') + #: The ID of the port for which you want to create an interface. port_id = resource.prop('port_id') + #: The port state. port_state = resource.prop('port_state') + #: The UUID for the server. server_id = resource.prop('server_id') diff --git a/openstack/compute/v2/server_ip.py b/openstack/compute/v2/server_ip.py index f01dab9b..ae9e710f 100644 --- a/openstack/compute/v2/server_ip.py +++ b/openstack/compute/v2/server_ip.py @@ -27,9 +27,13 @@ class ServerIP(resource.Resource): allow_list = True # Properties + #: The IP address. The format of the address depends on :attr:`version` addr = resource.prop('addr') + #: The network label, such as public or private. network_label = resource.prop('network_label') + #: The UUID for the server. server_id = resource.prop('server_id') + # Version of the IP protocol. Currently either 4 or 6. version = resource.prop('version') @classmethod diff --git a/openstack/compute/v2/server_meta.py b/openstack/compute/v2/server_meta.py index b40ad93b..71e628c7 100644 --- a/openstack/compute/v2/server_meta.py +++ b/openstack/compute/v2/server_meta.py @@ -31,8 +31,11 @@ class ServerMeta(resource.Resource): allow_list = True # Properties + #: The metadata key. key = resource.prop('key') + #: The ID of a server. server_id = resource.prop('server_id') + #: The metadata value. value = resource.prop('value') @classmethod diff --git a/openstack/compute/v2/server_metadata.py b/openstack/compute/v2/server_metadata.py index c2886624..8ffa5da3 100644 --- a/openstack/compute/v2/server_metadata.py +++ b/openstack/compute/v2/server_metadata.py @@ -26,6 +26,7 @@ class ServerMetadata(resource.Resource): allow_update = True # Properties + #: The ID of a server. server_id = resource.prop('server_id') @classmethod diff --git a/openstack/tests/compute/v2/test_server.py b/openstack/tests/compute/v2/test_server.py index 17c9cb9b..eb1575a1 100644 --- a/openstack/tests/compute/v2/test_server.py +++ b/openstack/tests/compute/v2/test_server.py @@ -22,12 +22,12 @@ EXAMPLE = { 'accessIPv6': '2', 'addresses': {'region': '3'}, 'created': '4', - 'flavorRef': 5, + 'flavorRef': {'id': 5}, 'hostId': '6', 'id': IDENTIFIER, - 'imageRef': 8, + 'imageRef': {'id': 8}, 'links': '9', - 'metadata': '10', + 'metadata': {'key': '10'}, 'name': '11', 'progress': 12, 'tenant_id': '13',