How to use the resource_key
and resources_key
in openstacksdk Resource?
In the openstack/compute/v2/Image
:
class Image(resource2.Resource, metadata.MetadataMixin):
resource_key = 'image'
resources_key = 'images'
base_path = '/images'
service = compute_service.ComputeService()
# capabilities
allow_get = True
allow_delete = True
allow_list = True
There are resource_key
,resources_key
and base_path
.
is this representative the resource path like rest_framework?
How to use the resource_key
, resources_key
and base_path
in openstacksdk?
the resource_key and resources_key are for internal interactions with backend services (e.g. nova compute, cinder storage). Users are not supposed to use them directly.
However, if you are planning to help out on improving openstacksdk, you will need to understand that resources_key is a component for your URL path to operate on a collection of objects, while resource_key is another path component for you to interact with a specific instance. Read some raw API design would be helpful for you to understand it.