Merge "Add docstrings for Metric resources"
This commit is contained in:
		| @@ -7,3 +7,4 @@ Metric Resources | ||||
|    v1/archive_policy | ||||
|    v1/capabilities | ||||
|    v1/metric | ||||
|    v1/resource | ||||
|   | ||||
							
								
								
									
										12
									
								
								doc/source/users/resources/metric/v1/resource.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								doc/source/users/resources/metric/v1/resource.rst
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| openstack.metric.v1.resource | ||||
| ============================ | ||||
|  | ||||
| .. automodule:: openstack.metric.v1.resource | ||||
|  | ||||
| The Generic Class | ||||
| ----------------- | ||||
|  | ||||
| The ``Generic`` class inherits from :class:`~openstack.resource.Resource`. | ||||
|  | ||||
| .. autoclass:: openstack.metric.v1.resource.Generic | ||||
|    :members: | ||||
| @@ -27,7 +27,11 @@ class ArchivePolicy(resource.Resource): | ||||
|     id_attribute = "name" | ||||
|  | ||||
|     # Properties | ||||
|     #: The name of this policy | ||||
|     name = resource.prop('name') | ||||
|     #: The definition of this policy | ||||
|     definition = resource.prop('definition', type=list) | ||||
|     #: The window of time older than the period that archives can be requested | ||||
|     back_window = resource.prop('back_window') | ||||
|     #: A list of the aggregation methods supported | ||||
|     aggregation_methods = resource.prop("aggregation_methods", type=list) | ||||
|   | ||||
| @@ -25,9 +25,15 @@ class Metric(resource.Resource): | ||||
|     allow_list = True | ||||
|  | ||||
|     # Properties | ||||
|     #: The name of the archive policy | ||||
|     archive_policy_name = resource.prop('archive_policy_name') | ||||
|     #: The archive policy | ||||
|     archive_policy = resource.prop('archive_policy') | ||||
|     #: The ID of the user who created this metric | ||||
|     created_by_user_id = resource.prop('created_by_user_id') | ||||
|     #: The ID of the project this metric was created under | ||||
|     created_by_project_id = resource.prop('created_by_project_id') | ||||
|     #: The identifier of this metric | ||||
|     resource_id = resource.prop('resource_id') | ||||
|     #: The name of this metric | ||||
|     name = resource.prop('name') | ||||
|   | ||||
| @@ -26,15 +26,23 @@ class Generic(resource.Resource): | ||||
|     allow_update = True | ||||
|  | ||||
|     # Properties | ||||
|     #: The identifier of this resource | ||||
|     id = resource.prop('id', alias="resource_id") | ||||
|     #: The ID of the user who created this resource | ||||
|     created_by_user_id = resource.prop('created_by_user_id') | ||||
|     #: The ID of the project this resource was created under | ||||
|     created_by_project_id = resource.prop('created_by_project_id') | ||||
|     #: The ID of the user | ||||
|     user_id = resource.prop('user_id') | ||||
|     #: The ID of the project | ||||
|     project_id = resource.prop('project_id') | ||||
|     #: Timestamp when this resource was started | ||||
|     started_at = resource.prop('started_at', | ||||
|                                type=resource_types.ISO8601Datetime) | ||||
|     #: Timestamp when this resource was ended | ||||
|     ended_at = resource.prop('ended_at', | ||||
|                              type=resource_types.ISO8601Datetime) | ||||
|     #: A dictionary of metrics collected on this resource | ||||
|     metrics = resource.prop('metrics', type=dict) | ||||
|  | ||||
|     def create(self, session): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jenkins
					Jenkins