class PoolMember(resource.Resource): resource_key = 'member' resources_key = 'members' base_path = '/lbaas/pools/%(pool_id)s/members' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: The IP address of the pool member. address = resource.prop('address') #: The administrative state of the pool member, which is up ``True`` or #: down ``False``. *Type: bool* admin_state_up = resource.prop('admin_state_up', type=bool) #: The project this pool member is associated with. project_id = resource.prop('tenant_id') #: The port on which the application is hosted. protocol_port = resource.prop('protocol_port', type=int) #: The status of the member. Indicates whether the member is operational. status = resource.prop('status') #: Subnet in which to access this pool member. subnet_id = resource.prop('subnet_id') #: A positive integer value that indicates the relative portion of traffic #: that this member should receive from the pool. For example, a member #: with a weight of 10 receives five times as much traffic as a member #: with weight of 2. weight = resource.prop('weight', type=int)
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')
class Host(resource.Resource): resource_key = 'host' resources_key = 'hosts' base_path = '/hosts' service = network_service.NetworkService() # capabilities allow_create = True allow_get = True allow_update = True allow_delete = True allow_list = True # ignores the id field on creating the resource; send a POST instead # of a PUT and do not append the ID to the end of the URL # the id field is required by the neutron command ignore_id_on_create = True # Properties subnets = resource.Body('subnets', type=int) name = resource.Body('name') routers = resource.Body('routers', type=int) created_at = resource.Body('created_at') updated_at = resource.Body('updated_at') availability = resource.Body('availability') id = resource.Body('id') ports = resource.Body('ports', type=int) agents = resource.Body('agents', type=list)
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')
class MeteringLabel(resource.Resource): resource_key = 'metering_label' resources_key = 'metering_labels' base_path = '/metering/metering-labels' 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', '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)
def __init__(self, plugins=None): """User preference for each service. :param plugins: List of entry point namespaces to load. Create a new :class:`~openstack.profile.Profile` object with no preferences defined, but knowledge of the services. Services are identified by their service type, e.g.: 'identity', 'compute', etc. """ self._services = {} self._add_service(baremetal_service.BaremetalService(version="v1")) self._add_service( block_storage_service.BlockStorageService(version="v2")) self._add_service(clustering_service.ClusteringService(version="v1")) self._add_service(compute_service.ComputeService(version="v2")) self._add_service(database_service.DatabaseService(version="v1")) self._add_service(identity_service.IdentityService(version="v3")) self._add_service(image_service.ImageService(version="v2")) self._add_service(key_manager_service.KeyManagerService(version="v1")) self._add_service(lb_service.LoadBalancerService(version="v2")) self._add_service(message_service.MessageService(version="v1")) self._add_service(network_service.NetworkService(version="v2")) self._add_service( object_store_service.ObjectStoreService(version="v1")) self._add_service( orchestration_service.OrchestrationService(version="v1")) self._add_service(workflow_service.WorkflowService(version="v2")) self.service_keys = sorted(self._services.keys())
class ProvidernetConnectivityTest(resource.Resource): resource_key = 'providernet_connectivity_test' resources_key = 'providernet_connectivity_tests' base_path = '/wrs-provider/providernet-connectivity-tests' service = network_service.NetworkService() # capabilities allow_create = True allow_list = True _query_mapping = resource.QueryParameters( 'audit_uuid', 'providernet_id', 'host_id', 'segmentation_id' ) # Properties status = resource.Body('status') segmentation_id = resource.Body('segmentation_id') updated_at = resource.Body('updated_at') host_name = resource.Body('host_name') providernet_id = resource.Body('providernet_id') host_id = resource.Body('host_id') providernet_name = resource.Body('providernet_name') audit_uuid = resource.Body('audit_uuid') type = resource.Body('type') message = resource.Body('message')
class Segment(resource.Resource): """.. caution:: This API is a work in progress and is subject to change.""" resource_key = 'segment' resources_key = 'segments' base_path = '/segments' service = network_service.NetworkService() # capabilities allow_create = False allow_retrieve = True allow_update = False allow_delete = False allow_list = True # TODO(rtheis): Add description and name properties when support # is available. # Properties #: The ID of the network associated with this segment. network_id = resource.prop('network_id') #: The type of network associated with this segment, such as #: ``flat``, ``gre``, ``vlan`` or ``vxlan``. network_type = resource.prop('network_type') #: The name of the physical network associated with this segment. physical_network = resource.prop('physical_network') #: The segmentation ID for this segment. The network type #: defines the segmentation model, VLAN ID for ``vlan`` network type #: and tunnel ID for ``gre`` and ``vxlan`` network types. *Type: int* segmentation_id = resource.prop('segmentation_id', type=int)
class QoSPolicy(resource.Resource): resource_key = 'policy' resources_key = 'policies' base_path = '/qos/policies' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: QoS policy name. name = resource.prop('name') #: The ID of the project who owns the network. Only administrative #: users can specify a project ID other than their own. project_id = resource.prop('tenant_id') #: The QoS policy description. description = resource.prop('description') #: Indicates whether this QoS policy is shared across all projects. #: *Type: bool* is_shared = resource.prop('shared', type=bool) #: List of QoS rules applied to this QoS policy. rules = resource.prop('rules')
class QoSMinimumBandwidthRule(resource.Resource): resource_key = 'minimum_bandwidth_rule' resources_key = 'minimum_bandwidth_rules' base_path = '/qos/policies/%(qos_policy_id)s/minimum_bandwidth_rules' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: QoS minimum bandwidth rule id. id = resource.prop('id') #: The ID of the QoS policy who owns rule. qos_policy_id = resource.prop('qos_policy_id') #: Minimum bandwidth in kbps. min_kbps = resource.prop('min_kbps') #: Traffic direction from the tenant point of view. Valid values: 'egress' direction = resource.prop('direction') @classmethod def _get_create_body(cls, attrs): # Exclude qos_policy_id from attrs since it is not expected by QoS API. if 'qos_policy_id' in attrs: attrs.pop('qos_policy_id') return {cls.resource_key: attrs}
class Port(resource.Resource): resource_key = 'port' resources_key = 'ports' base_path = '/v2.0/ports' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties admin_state_up = resource.prop('admin_state_up', type=bool) allowed_address_pairs = resource.prop('allowed_address_pairs', type=dict) binding_host_id = resource.prop('binding:host_id') binding_profile = resource.prop('binding:profile') binding_vif_details = resource.prop('binding:vif_details', type=dict) binding_vif_type = resource.prop('binding:vif_type') binding_vnic_type = resource.prop('binding:vnic_type') device_id = resource.prop('device_id') device_owner = resource.prop('device_owner') extra_dhcp_opts = resource.prop('extra_dhcp_opts', type=dict) fixed_ips = resource.prop('fixed_ips', type=dict) mac_address = resource.prop('mac_address') name = resource.prop('name') network_id = resource.prop('network_id') project_id = resource.prop('tenant_id') security_groups = resource.prop('security_groups') status = resource.prop('status')
class LoadBalancer(resource.Resource): resource_key = 'loadbalancer' resources_key = 'loadbalancers' base_path = '/lbaas/loadbalancers' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: The administrative state of the load_balancer, which is up #: ``True`` or down ``False``. *Type: bool* admin_state_up = resource.prop('admin_state_up', type=bool) #: Description for the load_balancer. description = resource.prop('description') #: List of IDs of listeners associated with this load_balancer. #: *Type: list* listeners = resource.prop('listeners') #: Name of the load_balancer name = resource.prop('name') #: Status of load_balancer operating, e.g. ONLINE, OFFLINE. operating_status = resource.prop('operating_status') #: The project this load_balancer is associated with. project_id = resource.prop('tenant_id') #: Status of load_balancer provisioning, e.g. ACTIVE, INACTIVE. provisioning_status = resource.prop('provisioning_status') #: The IP address of the VIP. vip_address = resource.prop('vip_address') #: The ID of the subnet on which to allocate the VIP address. vip_subnet_id = resource.prop('vip_subnet_id')
class MeteringLabelRule(resource.Resource): resource_key = 'metering_label_rule' resources_key = 'metering_label_rules' base_path = '/metering/metering-label-rules' service = network_service.NetworkService() # 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')
class Network(resource.Resource): resource_key = 'network' resources_key = 'networks' base_path = '/v2.0/networks' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties admin_state_up = resource.prop('admin_state_up', type=bool) name = resource.prop('name') project_id = resource.prop('tenant_id') provider_network_type = resource.prop('provider:network_type') provider_physical_network = resource.prop('provider:physical_network') provider_segmentation_id = resource.prop('provider:segmentation_id') router_external = resource.prop('router:external') segments = resource.prop('segments') shared = resource.prop('shared', type=bool) status = resource.prop('status') subnets = resource.prop('subnets')
class Segment(resource.Resource): resource_key = 'segment' resources_key = 'segments' base_path = '/segments' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: The segment description. description = resource.prop('description') #: The segment name. name = resource.prop('name') #: The ID of the network associated with this segment. network_id = resource.prop('network_id') #: The type of network associated with this segment, such as #: ``flat``, ``geneve``, ``gre``, ``local``, ``vlan`` or ``vxlan``. network_type = resource.prop('network_type') #: The name of the physical network associated with this segment. physical_network = resource.prop('physical_network') #: The segmentation ID for this segment. The network type #: defines the segmentation model, VLAN ID for ``vlan`` network type #: and tunnel ID for ``geneve``, ``gre`` and ``vxlan`` network types. #: *Type: int* segmentation_id = resource.prop('segmentation_id', type=int)
class NetworkIPAvailability(resource.Resource): resource_key = 'network_ip_availability' resources_key = 'network_ip_availabilities' base_path = '/network-ip-availabilities' name_attribute = 'network_name' service = network_service.NetworkService() # capabilities allow_create = False allow_get = True allow_update = False allow_delete = False allow_list = True _query_mapping = resource.QueryParameters('network_id', 'network_name', project_id='tenant_id') # Properties #: Network ID to use when listing network IP availability. network_id = resource.Body('network_id') #: Network Name for the particular network IP availability. network_name = resource.Body('network_name') #: The Subnet IP Availability of all subnets of a network. #: *Type: list* subnet_ip_availability = resource.Body('subnet_ip_availability', type=list) #: The ID of the project this network IP availability is associated with. project_id = resource.Body('tenant_id') #: The total ips of a network. #: *Type: int* total_ips = resource.Body('total_ips', type=int) #: The used or consumed ip of a network #: *Type: int* used_ips = resource.Body('used_ips', type=int)
class QoSDSCPMarkingRule(resource.Resource): resource_key = 'dscp_marking_rule' resources_key = 'dscp_marking_rules' base_path = '/qos/policies/%(qos_policy_id)s/dscp_marking_rules' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: QoS DSCP marking rule id. id = resource.prop('id') #: The ID of the QoS policy who owns rule. qos_policy_id = resource.prop('qos_policy_id') #: DSCP mark field. dscp_mark = resource.prop('dscp_mark') @classmethod def _get_create_body(cls, attrs): # Exclude qos_policy_id from attrs since it is not expected by QoS API. if 'qos_policy_id' in attrs: attrs.pop('qos_policy_id') return {cls.resource_key: attrs}
class AvailabilityZone(_resource.Resource): resource_key = 'availability_zone' resources_key = 'availability_zones' base_path = '/availability_zones' service = network_service.NetworkService() # capabilities allow_create = False allow_get = False allow_update = 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')
class Listener(resource.Resource): resource_key = 'listener' resources_key = 'listeners' base_path = '/lbaas/listeners' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: The administrative state of the listener, which is up #: ``True`` or down ``False``. *Type: bool* admin_state_up = resource.prop('admin_state_up', type=bool) #: The maximum number of connections permitted for this load balancer. #: Default is infinite. connection_limit = resource.prop('connection_limit') #: ID of default pool. Must have compatible protocol with listener. default_pool_id = resource.prop('default_pool_id') #: Description for the listener. description = resource.prop('description') #: List of IDs of load_balancers associate with this listener. #: *Type: list* loadbalancers = resource.prop('loadbalancers') #: Name of the listener name = resource.prop('name') #: The project this listener is associated with. project_id = resource.prop('tenant_id') #: The protocol of the listener, which is TCP, HTTP, or HTTPS. protocol = resource.prop('protocol') #: Port the listener will listen to, e.g. 80. protocol_port = resource.prop('protocol_port')
class SecurityGroup(resource.Resource): resource_key = 'security_group' resources_key = 'security_groups' base_path = '/v2.0/security-groups' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties description = resource.prop('description') name = resource.prop('name') project_id = resource.prop('tenant_id') security_group_rules = resource.prop('security_group_rules') def __init__(self, attrs=None, loaded=False): super(SecurityGroup, self).__init__(attrs=attrs, loaded=loaded) try: rules = [] for rule in self.security_group_rules: rules.append(group_rules.SecurityGroupRule.existing(**rule)) self.security_group_rules = rules except AttributeError: pass
class SecurityGroup(resource.Resource): resource_key = 'security_group' resources_key = 'security_groups' base_path = '/security-groups' 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', 'name', project_id='tenant_id', ) # 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('tenant_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) #: Timestamp when the security group was last updated. updated_at = resource.Body('updated_at')
class Portforwarding(resource.Resource): resource_key = 'portforwarding' resources_key = 'portforwardings' base_path = '/portforwardings' service = network_service.NetworkService() # capabilities allow_create = True allow_get = True allow_update = True allow_delete = True allow_list = True _query_mapping = resource.QueryParameters( 'project_id', 'router_id', ) # Properties router_id = resource.Body('router_id') inside_addr = resource.Body('inside_addr') protocol = resource.Body('protocol') outside_port = resource.Body('outside_port', type=int) project_id = resource.Body('tenant_id') description = resource.Body('description') id = resource.Body('id') inside_port = resource.Body('inside_port', type=int)
def __init__(self, plugins=None): """User preference for each service. :param list plugins: List of entry point namespaces to load. Create a new :class:`~openstack.profile.Profile` object with no preferences defined, but knowledge of the services. Services are identified by their service type, e.g.: 'identity', 'compute', etc. """ self._preferences = {} self._services = {} self._add_service(cluster_service.ClusterService()) self._add_service(compute_service.ComputeService()) self._add_service(database_service.DatabaseService()) self._add_service(identity_service.IdentityService()) self._add_service(image_service.ImageService()) self._add_service(metric_service.MetricService()) self._add_service(network_service.NetworkService()) self._add_service(object_store_service.ObjectStoreService()) self._add_service(orchestration_service.OrchestrationService()) self._add_service(key_management_service.KeyManagementService()) self._add_service(telemetry_service.TelemetryService()) self._add_service(block_store_service.BlockStoreService()) self._add_service(message_service.MessageService()) if plugins: for plugin in plugins: self._load_plugin(plugin) self.service_names = sorted(self._services.keys())
class ProvidernetRange(resource.Resource): resource_key = 'providernet_range' resources_key = 'providernet_ranges' base_path = '/wrs-provider/providernet-ranges' service = network_service.NetworkService() # capabilities allow_create = True allow_get = True allow_update = True allow_delete = True allow_list = True _query_mapping = resource.QueryParameters( 'type', 'project_id', ) # Properties minimum = resource.Body('minimum', type=int) name = resource.Body('name') providernet_id = resource.Body('providernet_id') project_id = resource.Body('tenant_id') shared = resource.Body('shared', type=bool) providernet_name = resource.Body('providernet_name') providernet_type = resource.Body('providernet_type') id = resource.Body('id') maximum = resource.Body('maximum', type=int) description = resource.Body('description') ttl = resource.Body('ttl', type=int) port = resource.Body('port', type=int) group = resource.Body('group') mode = resource.Body('mode')
def __init__(self, plugins=None): """User preference for each service. :param plugins: List of entry point namespaces to load. Create a new :class:`~openstack.profile.Profile` object with no preferences defined, but knowledge of the services. Services are identified by their service type, e.g.: 'identity', 'compute', etc. """ self._services = {} self._add_service(anti_ddos_service.AntiDDosService(version="v1")) self._add_service(block_store_service.BlockStoreService(version="v2")) self._add_service(compute_service.ComputeService(version="v2")) self._add_service(cts_service.CTSService(version="v1")) self._add_service(dms_service.DMSService(version="v1")) self._add_service(identity_service.IdentityService(version="v3")) self._add_service(image_service.ImageService(version="v2")) self._add_service(kms_service.KMSService(version="v1")) self._add_service(maas_service.MaaSService(version="v1")) self._add_service(network_service.NetworkService(version="v2.0")) self._add_service( orchestration_service.OrchestrationService(version="v1")) self._add_service(smn_service.SMNService(version="v2")) # QianBiao.NG HuaWei Services self._add_service(dns_service.DNSService(version="v2")) self._add_service(cloud_eye_service.CloudEyeService(version="v1")) ass = auto_scaling_service.AutoScalingService(version="v1") self._add_service(ass) vbs_v2 = volume_backup_service.VolumeBackupService(version="v2") self._add_service(vbs_v2) self._add_service(map_reduce_service.MapReduceService(version="v1")) self._add_service(evs_service.EvsServiceV2_1(version='v2.1')) self._add_service(evs_service.EvsService(version='v2')) self._add_service(ecs_service.EcsService(version='v1')) self._add_service(ecs_service.EcsServiceV1_1(version='v1.1')) self._add_service(vpc_service.VpcService(version='v2.0')) self._add_service(bms_service.BmsService(version='v1')) self._add_service(lb_service.LoadBalancerService(version='v1')) # not support below service # self._add_service(message_service.MessageService(version="v1")) # self._add_service(cluster_service.ClusterService(version="v1")) # self._add_service(database_service.DatabaseService(version="v1")) # self._add_service(alarm_service.AlarmService(version="v2")) # self._add_service(bare_metal_service.BareMetalService(version="v1")) # self._add_service(key_manager_service.KeyManagerService(version="v1")) # self._add_service( # object_store_service.ObjectStoreService(version="v1")) self._add_service(rds_service.RDSService(version="v1")) self._add_service(cdn_service.CDNService(version='v1')) # self._add_service(rds_os_service.RDSService(version="v1")) # self._add_service(telemetry_service.TelemetryService(version="v2")) # self._add_service(workflow_service.WorkflowService(version="v2")) if plugins: for plugin in plugins: self._load_plugin(plugin) self.service_keys = sorted(self._services.keys())
class VPNService(resource.Resource): resource_key = 'vpnservice' resources_key = 'vpnservices' base_path = '/vpn/vpnservices' service = network_service.NetworkService() # capabilities allow_create = True allow_get = True allow_update = True allow_delete = True allow_list = True # Properties #: Human-readable description for the vpnservice. description = resource.Body('description') #: The external IPv4 address that is used for the VPN service. external_v4_ip = resource.Body('external_v4_ip') #: The external IPv6 address that is used for the VPN service. external_v6_ip = resource.Body('external_v6_ip') #: The administrative state of the vpnservice, which is up ``True`` or #: down ``False``. *Type: bool* is_admin_state_up = resource.Body('admin_state_up', type=bool) #: The vpnservice name. name = resource.Body('name') #: ID of the router into which the VPN service is inserted. router_id = resource.Body('router_id') #: The ID of the project this vpnservice is associated with. project_id = resource.Body('tenant_id') #: The vpnservice status. status = resource.Body('status') #: The ID of the subnet on which the tenant wants the vpnservice. subnet_id = resource.Body('subnet_id')
class MeteringLabelRule(resource.Resource): resource_key = 'metering_label_rule' resources_key = 'metering_label_rules' base_path = '/metering-label-rules' service = network_service.NetworkService() # capabilities allow_create = True allow_retrieve = True allow_update = True allow_delete = True allow_list = True # Properties #: ingress or egress: The direction in which metering rule is #: applied. Default: ``"ingress"`` direction = resource.prop('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* excluded = resource.prop('excluded', type=bool) #: The meteting label ID to associate with this metering rule. metering_label_id = resource.prop('metering_label_id') #: The remote IP prefix to be associated with this metering rule. remote_ip_prefix = resource.prop('remote_ip_prefix')
class Extension(resource.Resource): resource_key = 'extension' resources_key = 'extensions' base_path = '/extensions' service = network_service.NetworkService() id_attribute = "alias" # capabilities allow_retrieve = True allow_list = True # Properties #: An alias the extension is known under. alias = resource.prop('alias') #: Text describing what the extension does. description = resource.prop('description') #: Links pertaining to this extension. links = resource.prop('links') #: The name of this extension. name = resource.prop('name') #: A URL pointing to the namespace for this extension. namespace = resource.prop('namespace') #: Timestamp when the extension was last updated. #: *Type: datetime object parsed from ISO 8601 formatted string* updated_at = resource.prop('updated', type=format.ISO8601)
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)
class Policy(resource2.Resource): resource_key = 'l7policy' resources_key = 'l7policies' base_path = '/lbaas/l7policies' service = network_service.NetworkService() _query_mapping = resource2.QueryParameters("id", "tenant_id", "name", "admin_state_up", "description", "listener_id", "action", "position" ) allow_create = True allow_get = True allow_update = True allow_delete = True allow_list = True id = resource2.Body("id") tenant_id = resource2.Body("tenant_id") name = resource2.Body("name") admin_state_up = resource2.Body("admin_state_up", type=bool, default=True) description = resource2.Body("description") listener_id = resource2.Body("listener_id") action = resource2.Body("action") redirect_pool_id = resource2.Body("redirect_pool_id") redirect_url = resource2.URI("redirect_url") rules = resource2.Body("rules", type=list) position = resource2.Body("position", type=int)