/opt/imh-python/lib/python3.9/site-packages/openstack/network/v2
NameSizeModeActions
__pycache__/-0755rm
address_scope.py14950644editdlrm
agent.py48830644editdlrm
auto_allocated_topology.py17410644editdlrm
availability_zone.py14490644editdlrm
extension.py12720644editdlrm
firewall_group.py23230644editdlrm
firewall_policy.py36750644editdlrm
firewall_rule.py28120644editdlrm
flavor.py20730644editdlrm
floating_ip.py37840644editdlrm
health_monitor.py26320644editdlrm
listener.py26150644editdlrm
load_balancer.py22800644editdlrm
metering_label.py14430644editdlrm
metering_label_rule.py18880644editdlrm
network.py55450644editdlrm
network_ip_availability.py18230644editdlrm
network_segment_range.py28730644editdlrm
pool.py36760644editdlrm
pool_member.py20950644editdlrm
port.py65940644editdlrm
port_forwarding.py17300644editdlrm
qos_bandwidth_limit_rule.py13260644editdlrm
qos_dscp_marking_rule.py10920644editdlrm
qos_minimum_bandwidth_rule.py12420644editdlrm
qos_policy.py20430644editdlrm
qos_rule_type.py11030644editdlrm
quota.py56100644editdlrm
rbac_policy.py14750644editdlrm
router.py72420644editdlrm
security_group.py20590644editdlrm
security_group_rule.py39000644editdlrm
segment.py18650644editdlrm
service_profile.py14670644editdlrm
service_provider.py12420644editdlrm
subnet.py37430644editdlrm
subnet_pool.py34090644editdlrm
trunk.py28100644editdlrm
vpn_service.py19170644editdlrm
_base.py12390644editdlrm
_proxy.py1913740644editdlrm
__init__.py00644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/openstack/network/v2/agent.py (4883B)
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from openstack import resource from openstack import utils class Agent(resource.Resource): """Neutron agent extension.""" resource_key = 'agent' resources_key = 'agents' base_path = '/agents' # capabilities allow_create = False allow_fetch = True allow_commit = True allow_delete = True allow_list = True # NOTE: We skip query for JSON fields and datetime fields _query_mapping = resource.QueryParameters( 'agent_type', 'availability_zone', 'binary', 'description', 'host', 'topic', is_admin_state_up='admin_state_up', is_alive='alive', ) # Properties #: The type of network agent. agent_type = resource.Body('agent_type') #: Availability zone for the network agent. availability_zone = resource.Body('availability_zone') #: The name of the network agent's application binary. binary = resource.Body('binary') #: Network agent configuration data specific to the agent_type. configuration = resource.Body('configurations') #: Timestamp when the network agent was created. created_at = resource.Body('created_at') #: The network agent description. description = resource.Body('description') #: Timestamp when the network agent's heartbeat was last seen. last_heartbeat_at = resource.Body('heartbeat_timestamp') #: The host the agent is running on. host = resource.Body('host') #: The administrative state of the network agent, which is up #: ``True`` or down ``False``. *Type: bool* is_admin_state_up = resource.Body('admin_state_up', type=bool) #: Whether or not the network agent is alive. #: *Type: bool* is_alive = resource.Body('alive', type=bool) #: Whether or not the agent is succesffully synced towards placement. #: Agents supporting the guaranteed minimum bandwidth feature share their #: resource view with neutron-server and neutron-server share this view #: with placement, resources_synced represents the success of the latter. #: The value None means no resource view synchronization to Placement was #: attempted. true / false values signify the success of the last #: synchronization attempt. #: *Type: bool* resources_synced = resource.Body('resources_synced', type=bool) #: Timestamp when the network agent was last started. started_at = resource.Body('started_at') #: The messaging queue topic the network agent subscribes to. topic = resource.Body('topic') #: The HA state of the L3 agent. This is one of 'active', 'standby' or #: 'fault' for HA routers, or None for other types of routers. ha_state = resource.Body('ha_state') def add_agent_to_network(self, session, network_id): body = {'network_id': network_id} url = utils.urljoin(self.base_path, self.id, 'dhcp-networks') resp = session.post(url, json=body) return resp.json() def remove_agent_from_network(self, session, network_id): body = {'network_id': network_id} url = utils.urljoin(self.base_path, self.id, 'dhcp-networks', network_id) session.delete(url, json=body) def add_router_to_agent(self, session, router): body = {'router_id': router} url = utils.urljoin(self.base_path, self.id, 'l3-routers') resp = session.post(url, json=body) return resp.json() def remove_router_from_agent(self, session, router): body = {'router_id': router} url = utils.urljoin(self.base_path, self.id, 'l3-routers', router) session.delete(url, json=body) class NetworkHostingDHCPAgent(Agent): resource_key = 'agent' resources_key = 'agents' resource_name = 'dhcp-agent' base_path = '/networks/%(network_id)s/dhcp-agents' # capabilities allow_create = False allow_fetch = True allow_commit = False allow_delete = False allow_list = True # NOTE: Doesn't support query yet. class RouterL3Agent(Agent): resource_key = 'agent' resources_key = 'agents' base_path = '/routers/%(router_id)s/l3-agents' resource_name = 'l3-agent' # capabilities allow_create = False allow_retrieve = True allow_commit = False allow_delete = False allow_list = True # NOTE: No query parameter is supported