コード例 #1
0
class VolumeAttachment(resource.Resource):
    resource_key = 'volumeAttachment'
    resources_key = 'volumeAttachments'
    base_path = '/servers/%(server_id)s/os-volume_attachments'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = False
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters("limit", "offset")

    #: Name of the device such as, /dev/vdb.
    device = resource.Body('device')
    #: The ID of the attachment.
    id = resource.Body('id')
    #: The ID for the server.
    server_id = resource.URI('server_id')
    #: The ID of the attached volume.
    volume_id = resource.Body('volumeId')
    #: The ID of the attachment you want to delete or update.
    attachment_id = resource.Body('attachment_id', alternate_id=True)
    #: Virtual device tags for the attachment.
    tag = resource.Body('tag')
    # tag introduced in 2.70
    _max_microversion = '2.70'
コード例 #2
0
class MeteringLabelRule(resource.Resource):
    resource_key = 'metering_label_rule'
    resources_key = 'metering_label_rules'
    base_path = '/metering/metering-label-rules'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'direction', 'metering_label_id', 'remote_ip_prefix',
        project_id='tenant_id',
    )

    # Properties
    #: ingress or egress: The direction in which metering label rule is
    #: applied. Default: ``"ingress"``
    direction = resource.Body('direction')
    #: Specify whether the ``remote_ip_prefix`` will be excluded or not
    #: from traffic counters of the metering label, ie: to not count the
    #: traffic of a specific IP address of a range. Default: ``False``,
    #: *Type: bool*
    is_excluded = resource.Body('excluded', type=bool)
    #: The metering label ID to associate with this metering label rule.
    metering_label_id = resource.Body('metering_label_id')
    #: The ID of the project this metering label rule is associated with.
    project_id = resource.Body('tenant_id')
    #: The remote IP prefix to be associated with this metering label rule.
    remote_ip_prefix = resource.Body('remote_ip_prefix')
コード例 #3
0
class SecurityGroup(resource.Resource, resource.TagMixin):
    resource_key = 'security_group'
    resources_key = 'security_groups'
    base_path = '/security-groups'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'description', 'name', 'project_id', 'tenant_id', 'revision_number',
        'sort_dir', 'sort_key', **resource.TagMixin._tag_query_parameters)

    # Properties
    #: Timestamp when the security group was created.
    created_at = resource.Body('created_at')
    #: The security group description.
    description = resource.Body('description')
    #: The security group name.
    name = resource.Body('name')
    #: The ID of the project this security group is associated with.
    project_id = resource.Body('project_id')
    #: Revision number of the security group. *Type: int*
    revision_number = resource.Body('revision_number', type=int)
    #: A list of
    #: :class:`~openstack.network.v2.security_group_rule.SecurityGroupRule`
    #: objects. *Type: list*
    security_group_rules = resource.Body('security_group_rules', type=list)
    #: The ID of the project this security group is associated with.
    tenant_id = resource.Body('tenant_id')
    #: Timestamp when the security group was last updated.
    updated_at = resource.Body('updated_at')
コード例 #4
0
class MeteringLabel(resource.Resource):
    resource_key = 'metering_label'
    resources_key = 'metering_labels'
    base_path = '/metering/metering-labels'

    _allow_unknown_attrs_in_body = True

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters('description',
                                              'name',
                                              is_shared='shared',
                                              project_id='tenant_id')

    # Properties
    #: Description of the metering label.
    description = resource.Body('description')
    #: Name of the metering label.
    name = resource.Body('name')
    #: The ID of the project this metering label is associated with.
    project_id = resource.Body('tenant_id')
    #: Indicates whether this label is shared across all tenants.
    #: *Type: bool*
    is_shared = resource.Body('shared', type=bool)
コード例 #5
0
class FederationProtocol(resource.Resource):
    resource_key = 'protocol'
    resources_key = 'protocols'
    base_path = '/OS-FEDERATION/identity_providers/%(idp_id)s/protocols'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    create_exclude_id_from_body = True
    create_method = 'PUT'
    commit_method = 'PATCH'

    _query_mapping = resource.QueryParameters('id', )

    # Properties
    #: name of the protocol (read only) *Type: string*
    name = resource.Body('id')
    #: The ID of the identity provider the protocol is attached to.
    #  *Type: string*
    idp_id = resource.URI('idp_id')
    #: The definition of the protocol
    #  *Type: dict*
    mapping_id = resource.Body('mapping_id')
コード例 #6
0
class Task(resource.Resource):
    resources_key = 'tasks'
    base_path = '/tasks'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'type', 'status', 'sort_dir', 'sort_key'
    )

    #: The date and time when the task was created.
    created_at = resource.Body('created_at')
    #: The date and time when the task is subject to removal.
    expires_at = resource.Body('expires_at')
    #: A JSON object specifying the input parameters to the task.
    input = resource.Body('input')
    #: Human-readable text, possibly an empty string, usually displayed
    #: in an error situation to provide more information about what
    #: has occurred.
    message = resource.Body('message')
    #: The ID of the owner, or project, of the task.
    owner_id = resource.Body('owner')
    #: A JSON object specifying the outcome of the task.
    result = resource.Body('result')
    #: The URL for schema of the task.
    schema = resource.Body('schema')
    #: The status of the task.
    status = resource.Body('status')
    #: The type of task represented by this content.
    type = resource.Body('type')
    #: The date and time when the task was updated.
    updated_at = resource.Body('updated_at')
コード例 #7
0
class AvailabilityZone(_resource.Resource):
    resource_key = 'availability_zone'
    resources_key = 'availability_zones'
    base_path = '/availability_zones'

    # capabilities
    allow_create = False
    allow_fetch = False
    allow_commit = False
    allow_delete = False
    allow_list = True

    # NOTE: We don't support query by state yet because there is a mapping
    #       at neutron side difficult to map.
    _query_mapping = _resource.QueryParameters(name='availability_zone',
                                               resource='agent_type')

    # Properties
    #: Name of the availability zone.
    name = _resource.Body('name')
    #: Type of resource for the availability zone, such as ``network``.
    resource = _resource.Body('resource')
    #: State of the availability zone, either ``available`` or
    #: ``unavailable``.
    state = _resource.Body('state')
コード例 #8
0
ファイル: action.py プロジェクト: xiaobu2954/openstacksdk
class Action(resource.Resource):
    resource_key = 'action'
    resources_key = 'actions'
    base_path = '/actions'

    # Capabilities
    allow_list = True
    allow_fetch = True
    allow_commit = True

    commit_method = 'PATCH'

    _query_mapping = resource.QueryParameters(
        'name', 'action', 'status', 'sort', 'global_project',
        target_id='target')

    # Properties
    #: Name of the action.
    name = resource.Body('name')
    #: ID of the target object, which can be a cluster or a node.
    target_id = resource.Body('target')
    #: Built-in type name of action.
    action = resource.Body('action')
    #: A string representation of the reason why the action was created.
    cause = resource.Body('cause')
    #: The owning engine that is currently running the action.
    owner_id = resource.Body('owner')
    #: The ID of the user who created this action.
    user_id = resource.Body('user')
    #: The ID of the project this profile belongs to.
    project_id = resource.Body('project')
    #: The domain ID of the action.
    domain_id = resource.Body('domain')
    #: Interval in seconds between two consecutive executions.
    interval = resource.Body('interval')
    #: The time the action was started.
    start_at = resource.Body('start_time')
    #: The time the action completed execution.
    end_at = resource.Body('end_time')
    #: The timeout in seconds.
    timeout = resource.Body('timeout')
    #: Current status of the action.
    status = resource.Body('status')
    #: A string describing the reason that brought the action to its current
    #  status.
    status_reason = resource.Body('status_reason')
    #: A dictionary containing the inputs to the action.
    inputs = resource.Body('inputs', type=dict)
    #: A dictionary containing the outputs to the action.
    outputs = resource.Body('outputs', type=dict)
    #: A list of actions that must finish before this action starts execution.
    depends_on = resource.Body('depends_on', type=list)
    #: A list of actions that can start only after this action has finished.
    depended_by = resource.Body('depended_by', type=list)
    #: Timestamp when the action is created.
    created_at = resource.Body('created_at')
    #: Timestamp when the action was last updated.
    updated_at = resource.Body('updated_at')
    #: The ID of cluster which this action runs on.
    cluster_id = resource.Body('cluster_id')
コード例 #9
0
class IdentityProvider(resource.Resource):
    resource_key = 'identity_provider'
    resources_key = 'identity_providers'
    base_path = '/OS-FEDERATION/identity_providers'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    create_method = 'PUT'
    create_exclude_id_from_body = True
    commit_method = 'PATCH'

    _query_mapping = resource.QueryParameters(
        'id',
        is_enabled='enabled',
    )

    # Properties
    #: The id of a domain associated with this identity provider.
    #  *Type: string*
    domain_id = resource.Body('domain_id')
    #: A description of this identity provider. *Type: string*
    description = resource.Body('description')
    #: If the identity provider is currently enabled. *Type: bool*
    is_enabled = resource.Body('enabled', type=bool)
    #: Remote IDs associated with the identity provider. *Type: list*
    remote_ids = resource.Body('remote_ids', type=list)

    #: The identifier of the identity provider (read only). *Type: string*
    name = resource.Body('id')
コード例 #10
0
class ClusterPolicy(resource.Resource):
    resource_key = 'cluster_policy'
    resources_key = 'cluster_policies'
    base_path = '/clusters/%(cluster_id)s/policies'
    service = clustering_service.ClusteringService()

    # Capabilities
    allow_list = True
    allow_get = True

    _query_mapping = resource.QueryParameters('sort',
                                              'policy_name',
                                              'policy_type',
                                              is_enabled='enabled')

    # Properties
    #: ID of the policy object.
    policy_id = resource.Body('policy_id', alternate_id=True)
    #: Name of the policy object.
    policy_name = resource.Body('policy_name')
    #: ID of the cluster object.
    cluster_id = resource.URI('cluster_id')
    #: Name of the cluster object.
    cluster_name = resource.Body('cluster_name')
    #: Type string of the policy.
    policy_type = resource.Body('policy_type')
    #: Whether the policy is enabled on the cluster. *Type: bool*
    is_enabled = resource.Body('enabled', type=bool)
    #: Data associated with the cluster-policy binding.
    data = resource.Body('data', type=dict)
コード例 #11
0
class Credential(resource.Resource):
    resource_key = 'credential'
    resources_key = 'credentials'
    base_path = '/credentials'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    commit_method = 'PATCH'

    _query_mapping = resource.QueryParameters(
        'type',
        'user_id',
    )

    # Properties
    #: Arbitrary blob of the credential data, to be parsed according to the
    #: ``type``. *Type: string*
    blob = resource.Body('blob')
    #: References a project ID which limits the scope the credential applies
    #: to. This attribute is **mandatory** if the credential type is ``ec2``.
    #: *Type: string*
    project_id = resource.Body('project_id')
    #: Representing the credential type, such as ``ec2`` or ``cert``.
    #: A specific implementation may determine the list of supported types.
    #: *Type: string*
    type = resource.Body('type')
    #: References the user ID which owns the credential. *Type: string*
    user_id = resource.Body('user_id')
コード例 #12
0
ファイル: service.py プロジェクト: Supriya30201/gskube
class Service(resource.Resource):
    resource_key = 'service'
    resources_key = 'services'
    base_path = '/services'
    service = identity_service.IdentityService()

    # capabilities
    allow_create = True
    allow_get = True
    allow_update = True
    allow_delete = True
    allow_list = True
    update_method = 'PATCH'

    _query_mapping = resource.QueryParameters(
        'type',
    )

    # Properties
    #: User-facing description of the service. *Type: string*
    description = resource.Body('description')
    #: Setting this value to ``False`` prevents the service and
    #: its endpoints from appearing in the service catalog. *Type: bool*
    is_enabled = resource.Body('enabled', type=bool)
    #: The links for the service resource.
    links = resource.Body('links')
    #: User-facing name of the service. *Type: string*
    name = resource.Body('name')
    #: Describes the API implemented by the service. The following values are
    #: recognized within the OpenStack ecosystem: ``compute``, ``image``,
    #: ``ec2``, ``identity``, ``volume``, ``network``. To support non-core and
    #: future projects, the value should not be validated against this list.
    #: *Type: string*
    type = resource.Body('type')
コード例 #13
0
class Topic(resource.Resource):
    resources_key = 'topics'
    base_path = '/notifications/topics'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters('offset', 'limit')

    #: Resource identifier of a topic, which is unique
    id = resource.Body('topic_urn', alternate_id=True)
    #: Time when the topic was created
    #: The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.
    create_time = resource.Body('create_time')
    #: Topic display name, which is presented as the name of
    #: the email sender in email messages
    #: Contains only digits, letters, underscores and hyphens
    display_name = resource.Body('display_name')
    #: Specifies the Topic Name.
    #: Contains only digits, letters, underscores and hyphens
    name = resource.Body('name')
    #: Message push policy
    #: 0: Failed messages will be saved in message queues.
    #: 1: Failed messages will be discarded.
    push_policy = resource.Body('push_policy', type=int)
    #: Unique Request ID
    request_id = resource.Body('request_id')
    #: Time when the topic was updated
    #: The UTC time is in YYYY-MM-DDTHH:MM:SSZ format.
    update_time = resource.Body('update_time')
コード例 #14
0
class Policy(resource.Resource):
    """CBR Policy Resource"""
    resource_key = 'policy'
    resources_key = 'policies'
    base_path = '/policies'

    # capabilities
    allow_create = True
    allow_list = True
    allow_fetch = True
    allow_delete = True
    allow_commit = True

    _query_mapping = resource.QueryParameters('operation_type', 'vault_id')

    #: Properties
    #: associated vault
    associated_vaults = resource.Body('associated_vaults',
                                      type=list,
                                      list_type=Vault)
    #: Whether to enable the policy
    enabled = resource.Body('enabled', type=bool)
    #: Policy ID
    id = resource.Body('id')
    #: Policy Name
    #: Max: 64 chars
    name = resource.Body('name')
    #: Scheduling parameter
    operation_definition = resource.Body('operation_definition',
                                         type=OperationDefinition)
    #: Policy type
    #: values: backup, replication
    operation_type = resource.Body('operation_type')
    #: Time rule for the policy execution
    trigger = resource.Body('trigger', type=Trigger)
コード例 #15
0
class DeployTemplate(_common.ListMixin, resource.Resource):

    resources_key = 'deploy_templates'
    base_path = '/deploy_templates'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    allow_patch = True
    commit_method = 'PATCH'
    commit_jsonpatch = True

    _query_mapping = resource.QueryParameters(
        'detail',
        fields={'type': _common.fields_type},
    )

    # Deploy Templates is available since 1.55
    _max_microversion = '1.55'
    name = resource.Body('name')
    #: Timestamp at which the deploy_template was created.
    created_at = resource.Body('created_at')
    #: A set of one or more arbitrary metadata key and value pairs.
    extra = resource.Body('extra')
    #: A list of relative links. Includes the self and bookmark links.
    links = resource.Body('links', type=list)
    #: A set of physical information of the deploy_template.
    steps = resource.Body('steps', type=list)
    #: Timestamp at which the deploy_template was last updated.
    updated_at = resource.Body('updated_at')
    #: The UUID of the resource.
    id = resource.Body('uuid', alternate_id=True)
コード例 #16
0
class Restore(resource.Resource):
    """CBR Backup Resource"""
    resource_key = 'restore'
    resources_key = ''
    base_path = '/backups/%(backup_id)s/restore'

    # capabilities
    allow_create = True
    allow_list = False
    allow_fetch = False
    allow_delete = False
    allow_commit = False

    _query_mapping = resource.QueryParameters()

    #: Properties
    #: URI backup reference
    backup = resource.URI('backup_id')
    #: Restores mapping relationship.
    #: Mandatory for VM restoreation and optional for disk restoration
    mappings = resource.Body('mappings', type=Mappings)
    #: Whether the server is powered on after restoration.
    #: Default: True
    power_on = resource.Body('power_on', type=bool)
    #: ID of the resource to be restored
    resource_id = resource.Body('resource_id')
    #: ID of the target VM to be restored.
    #: Mandatory for VM restoration.
    server_id = resource.Body('server_id')
    #: ID of the target disk to be restored
    #: This parameter is mandatory for disk restoration
    volume_id = resource.Body('volume_id')
コード例 #17
0
class RoleAssignment(resource.Resource):
    resource_key = 'role_assignment'
    resources_key = 'role_assignments'
    base_path = '/role_assignments'
    service = identity_service.IdentityService()

    # capabilities
    allow_list = True

    _query_mapping = resource.QueryParameters('group_id', 'role_id',
                                              'scope_domain_id',
                                              'scope_project_id', 'user_id',
                                              'effective', 'include_names',
                                              'include_subtree')

    # Properties
    #: The links for the service resource.
    links = resource.Body('links')
    #: The role (dictionary contains only id) *Type: dict*
    role = resource.Body('role', type=dict)
    #: The scope (either domain or group dictionary contains id) *Type: dict*
    scope = resource.Body('scope', type=dict)
    #: The user (dictionary contains only id) *Type: dict*
    user = resource.Body('user', type=dict)
    #: The group (dictionary contains only id) *Type: dict*
    group = resource.Body('group', type=dict)
コード例 #18
0
class ServiceProvider(resource.Resource):
    resources_key = 'service_providers'
    base_path = '/service-providers'

    _allow_unknown_attrs_in_body = True

    # Capabilities
    allow_create = False
    allow_fetch = False
    allow_commit = False
    allow_delete = False
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'service_type', 'name',
        is_default='default'
    )

    # Properties
    #: Service type (FIREWALL, FLAVORS, METERING, QOS, etc..)
    service_type = resource.Body('service_type')
    #: Name of the service type
    name = resource.Body('name')
    #: The default value of service type
    is_default = resource.Body('default', type=bool)
コード例 #19
0
class Chassis(_common.ListMixin, resource.Resource):

    resources_key = 'chassis'
    base_path = '/chassis'

    # Specifying fields became possible in 1.8.
    _max_microversion = '1.8'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    allow_patch = True
    commit_method = 'PATCH'
    commit_jsonpatch = True

    _query_mapping = resource.QueryParameters(
        fields={'type': _common.fields_type}, )

    #: Timestamp at which the chassis was created.
    created_at = resource.Body('created_at')
    #: A descriptive text about the service
    description = resource.Body('description')
    #: A set of one or more arbitrary metadata key and value pairs.
    extra = resource.Body('extra')
    #: The UUID for the chassis
    id = resource.Body('uuid', alternate_id=True)
    #: A list of relative links, including the self and bookmark links.
    links = resource.Body('links', type=list)
    #: Links to the collection of nodes contained in the chassis
    nodes = resource.Body('nodes', type=list)
    #: Timestamp at which the chassis was last updated.
    updated_at = resource.Body('updated_at')
コード例 #20
0
ファイル: amphora.py プロジェクト: williamwang0/MusicGen
class Amphora(resource.Resource):
    resource_key = 'amphora'
    resources_key = 'amphorae'
    base_path = '/octavia/amphorae'

    # capabilities
    allow_create = False
    allow_fetch = True
    allow_commit = False
    allow_delete = False
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'id', 'loadbalancer_id', 'compute_id', 'lb_network_ip', 'vrrp_ip',
        'ha_ip', 'vrrp_port_id', 'ha_port_id', 'cert_expiration', 'cert_busy',
        'role', 'status', 'vrrp_interface', 'vrrp_id', 'vrrp_priority',
        'cached_zone', 'created_at', 'updated_at', 'image_id', 'image_id')

    # Properties
    #: The ID of the amphora.
    id = resource.Body('id')
    #: The ID of the load balancer.
    loadbalancer_id = resource.Body('loadbalancer_id')
    #: The ID of the amphora resource in the compute system.
    compute_id = resource.Body('compute_id')
    #: The management IP of the amphora.
    lb_network_ip = resource.Body('lb_network_ip')
    #: The address of the vrrp port on the amphora.
    vrrp_ip = resource.Body('vrrp_ip')
    #: The IP address of the Virtual IP (VIP).
    ha_ip = resource.Body('ha_ip')
    #: The vrrp port's ID in the networking system.
    vrrp_port_id = resource.Body('vrrp_port_id')
    #: The ID of the Virtual IP (VIP) port.
    ha_port_id = resource.Body('ha_port_id')
    #: The date the certificate for the amphora expires.
    cert_expiration = resource.Body('cert_expiration')
    #: Whether the certificate is in the process of being replaced.
    cert_busy = resource.Body('cert_busy')
    #: The role configured for the amphora. One of STANDALONE, MASTER, BACKUP.
    role = resource.Body('role')
    #: The status of the amphora. One of: BOOTING, ALLOCATED, READY,
    #: PENDING_CREATE, PENDING_DELETE, DELETED, ERROR.
    status = resource.Body('status')
    #: The bound interface name of the vrrp port on the amphora.
    vrrp_interface = resource.Body('vrrp_interface')
    #: The vrrp group's ID for the amphora.
    vrrp_id = resource.Body('vrrp_id')
    #: The priority of the amphora in the vrrp group.
    vrrp_priority = resource.Body('vrrp_priority')
    #: The availability zone of a compute instance, cached at create time.
    cached_zone = resource.Body('cached_zone')
    #: The UTC date and timestamp when the resource was created.
    created_at = resource.Body('created_at')
    #: The UTC date and timestamp when the resource was last updated.
    updated_at = resource.Body('updated_at')
    #: The ID of the glance image used for the amphora.
    image_id = resource.Body('image_id')
    #: The ID of the compute flavor used for the amphora.
    compute_flavor = resource.Body('compute_flavor')
コード例 #21
0
class FlowClassifier(resource.Resource):
    resource_key = 'flow_classifier'
    resources_key = 'flow_classifiers'
    base_path = '/sfc/flow_classifiers'

    allow_create = True
    allow_get = True
    allow_update = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters('name')

    name = resource.Body('name')
    description = resource.Body('description')
    ethertype = resource.Body('ingress')
    protocol = resource.Body('protocol')
    source_port_range_min = resource.Body('source_port_range_min')
    source_port_range_max = resource.Body('source_port_range_max')
    destination_port_range_min = resource.Body('destination_port_range_min')
    destination_port_range_max = resource.Body('destination_port_range_max')
    source_ip_prefix = resource.Body('source_ip_prefix')
    destination_ip_prefix = resource.Body('destination_ip_prefix')
    logical_source_port = resource.Body('logical_source_port')
    logical_destination_port = resource.Body('logical_destination_port')
    l7_parameters = resource.Body('l7_parameters', type=dict)
コード例 #22
0
class Group(resource.Resource):
    resource_key = 'group'
    resources_key = 'groups'
    base_path = '/groups'

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    commit_method = 'PATCH'

    _query_mapping = resource.QueryParameters(
        'domain_id',
        'name',
    )

    # Properties
    #: The description of this group. *Type: string*
    description = resource.Body('description')
    #: References the domain ID which owns the group; if a domain ID is not
    #: specified by the client, the Identity service implementation will
    #: default it to the domain ID to which the client's token is scoped.
    #: *Type: string*
    domain_id = resource.Body('domain_id')
    #: Unique group name, within the owning domain. *Type: string*
    name = resource.Body('name')
コード例 #23
0
ファイル: flavor.py プロジェクト: zsoltn/python-otcextensions
class Flavor(sdk_resource.Resource):

    base_path = '/flavors'
    # In difference to regular OS services RDS
    # does not return single item with a proper element tag
    resource_key = 'flavor'
    resources_key = 'flavors'

    # capabilities
    allow_get = True
    allow_list = True

    _query_mapping = resource.QueryParameters('dbId', 'region')

    # Properties
    #: Flavor id
    id = None
    #: Flavor name
    name = resource.Body('name')
    #: Ram size in MB.
    #: *Type:int*
    ram = resource.Body('ram', type=int)
    #: Specification code
    #: *Type: str*
    spec_code = resource.Body('specCode')
コード例 #24
0
class VolumeAttachment(resource.Resource):
    resource_key = 'volumeAttachment'
    resources_key = 'volumeAttachments'
    base_path = '/servers/%(server_id)s/os-volume_attachments'
    service = compute_service.ComputeService()

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = False
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters("limit", "offset")

    #: Name of the device such as, /dev/vdb.
    device = resource.Body('device')
    #: The ID of the attachment.
    id = resource.Body('id')
    #: The ID for the server.
    server_id = resource.URI('server_id')
    #: The ID of the attached volume.
    volume_id = resource.Body('volumeId')
    #: The ID of the attachment you want to delete or update.
    attachment_id = resource.Body('attachment_id', alternate_id=True)
コード例 #25
0
class ServiceProfile(resource.Resource):
    resource_key = 'service_profile'
    resources_key = 'service_profiles'
    base_path = '/service_profiles'
    service = network_service.NetworkService()

    # capabilities
    allow_create = True
    allow_get = True
    allow_update = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters('description',
                                              'driver',
                                              is_enabled='enabled',
                                              project_id='tenant_id')
    # Properties
    #: Description of the service flavor profile.
    description = resource.Body('description')
    #: Provider driver for the service flavor profile
    driver = resource.Body('driver')
    #: Sets enabled flag
    is_enabled = resource.Body('enabled', type=bool)
    #: Metainformation of the service flavor profile
    meta_info = resource.Body('metainfo')
    #: The owner project ID
    project_id = resource.Body('tenant_id')
コード例 #26
0
class BackupTask(sdk_resource.Resource):
    """Cloud Backup"""
    resources_key = "tasks"
    base_path = "/backuppolicy/%(policy_id)s/backuptasks"

    # capabilities
    allow_list = True

    _query_mapping = resource.QueryParameters("sort_dir",
                                              "sort_key",
                                              "status",
                                              "limit",
                                              "marker",
                                              "offset",
                                              "status",
                                              id="job_id")

    #: Properties
    #: Task job id
    id = resource.Body("job_id", alternate_id=True)
    #: Name of backup created by this task name
    backup_name = resource.Body("backup_name")
    #: Resource ID (volume-id for example)
    resource_id = resource.Body("resource_id")
    #: Resource Type (volume for example)
    resource_type = resource.Body("resource_type")
    #: Task status, valid values include: ``RUNNING``, ``EXECUTE_TIMEOUT``,
    #: ``WAITING``, EXECUTE_FAIL``, ``EXECUTE_SUCCESS``
    status = resource.Body("status")
    #: task created at
    created_at = resource.Body("created_at")
    #: task finished at
    finished_at = resource.Body("finished_at")
コード例 #27
0
ファイル: rbac_policy.py プロジェクト: Supriya30201/gskube
class RBACPolicy(resource.Resource):
    resource_key = 'rbac_policy'
    resources_key = 'rbac_policies'
    base_path = '/rbac-policies'
    service = network_service.NetworkService()

    # capabilities
    allow_create = True
    allow_get = True
    allow_update = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'action', 'object_id', 'object_type', 'project_id',
        'target_project_id',
    )

    # Properties
    #: ID of the object that this RBAC policy affects.
    object_id = resource.Body('object_id')
    #: The ID of the project this RBAC will be enforced.
    target_project_id = resource.Body('target_tenant')
    #: The owner project ID.
    project_id = resource.Body('tenant_id')
    #: Type of the object that this RBAC policy affects.
    object_type = resource.Body('object_type')
    #: Action for the RBAC policy.
    action = resource.Body('action')
コード例 #28
0
class PortForwarding(resource.Resource):
    name_attribute = "floating_ip_port_forwarding"
    resource_name = "port forwarding"
    resource_key = 'port_forwarding'
    resources_key = 'port_forwardings'
    base_path = '/floatingips/%(floatingip_id)s/port_forwardings'

    _allow_unknown_attrs_in_body = True

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters('internal_port_id',
                                              'external_port', 'protocol')

    # Properties
    #: The ID of Floating IP address
    floatingip_id = resource.URI('floatingip_id')
    #: The ID of internal port
    internal_port_id = resource.Body('internal_port_id')
    #: The internal IP address
    internal_ip_address = resource.Body('internal_ip_address')
    #: The internal TCP/UDP/other port number
    internal_port = resource.Body('internal_port', type=int)
    #: The external TCP/UDP/other port number
    external_port = resource.Body('external_port', type=int)
    #: The protocol
    protocol = resource.Body('protocol')
    #: The description
    description = resource.Body('description')
コード例 #29
0
ファイル: address_scope.py プロジェクト: Supriya30201/gskube
class AddressScope(resource.Resource):
    """Address scope extension."""
    resource_key = 'address_scope'
    resources_key = 'address_scopes'
    base_path = '/address-scopes'
    service = network_service.NetworkService()

    # capabilities
    allow_create = True
    allow_get = True
    allow_update = True
    allow_delete = True
    allow_list = True

    _query_mapping = resource.QueryParameters(
        'name',
        'ip_version',
        project_id='tenant_id',
        is_shared='shared',
    )

    # Properties
    #: The address scope name.
    name = resource.Body('name')
    #: The ID of the project that owns the address scope.
    project_id = resource.Body('tenant_id')
    #: The IP address family of the address scope.
    #: *Type: int*
    ip_version = resource.Body('ip_version', type=int)
    #: Indicates whether this address scope is shared across all projects.
    #: *Type: bool*
    is_shared = resource.Body('shared', type=bool)
コード例 #30
0
ファイル: chassis.py プロジェクト: useitcloud/openstacksdk
class Chassis(resource.Resource):

    resources_key = 'chassis'
    base_path = '/chassis'
    service = baremetal_service.BaremetalService()

    # capabilities
    allow_create = True
    allow_fetch = True
    allow_commit = True
    allow_delete = True
    allow_list = True
    commit_method = 'PATCH'
    commit_jsonpatch = True

    _query_mapping = resource.QueryParameters('fields')

    #: Timestamp at which the chassis was created.
    created_at = resource.Body('created_at')
    #: A descriptive text about the service
    description = resource.Body('description')
    #: A set of one or more arbitrary metadata key and value pairs.
    extra = resource.Body('extra')
    #: The UUID for the chassis
    id = resource.Body('uuid', alternate_id=True)
    #: A list of relative links, including the self and bookmark links.
    links = resource.Body('links', type=list)
    #: Links to the collection of nodes contained in the chassis
    nodes = resource.Body('nodes', type=list)
    #: Timestamp at which the chassis was last updated.
    updated_at = resource.Body('updated_at')