INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Show the details of an existing static address.
def show_address(kwargs=None, call=None): ''' Show the details of an existing static address. CLI Example: .. code-block:: bash salt-cloud -f show_address gce name=mysnapshot region=us-central1 ''' if call != 'function': raise SaltCloudSystemExit( 'The show_snapsho...
Create a load - balancer configuration.
def create_lb(kwargs=None, call=None): ''' Create a load-balancer configuration. CLI Example: .. code-block:: bash salt-cloud -f create_lb gce name=lb region=us-central1 ports=80 ''' if call != 'function': raise SaltCloudSystemExit( 'The create_lb function must be ...
Permanently delete a load - balancer.
def delete_lb(kwargs=None, call=None): ''' Permanently delete a load-balancer. CLI Example: .. code-block:: bash salt-cloud -f delete_lb gce name=lb ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_hc function must be called with -f or --function.'...
Show the details of an existing load - balancer.
def show_lb(kwargs=None, call=None): ''' Show the details of an existing load-balancer. CLI Example: .. code-block:: bash salt-cloud -f show_lb gce name=lb ''' if call != 'function': raise SaltCloudSystemExit( 'The show_lb function must be called with -f or --funct...
Add an existing node/ member to an existing load - balancer configuration.
def attach_lb(kwargs=None, call=None): ''' Add an existing node/member to an existing load-balancer configuration. CLI Example: .. code-block:: bash salt-cloud -f attach_lb gce name=lb member=myinstance ''' if call != 'function': raise SaltCloudSystemExit( 'The att...
Remove an existing node/ member from an existing load - balancer configuration.
def detach_lb(kwargs=None, call=None): ''' Remove an existing node/member from an existing load-balancer configuration. CLI Example: .. code-block:: bash salt-cloud -f detach_lb gce name=lb member=myinstance ''' if call != 'function': raise SaltCloudSystemExit( 'Th...
Permanently delete a disk snapshot.
def delete_snapshot(kwargs=None, call=None): ''' Permanently delete a disk snapshot. CLI Example: .. code-block:: bash salt-cloud -f delete_snapshot gce name=disk-snap-1 ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_snapshot function must be cal...
Permanently delete a persistent disk.
def delete_disk(kwargs=None, call=None): ''' Permanently delete a persistent disk. CLI Example: .. code-block:: bash salt-cloud -f delete_disk gce disk_name=pd ''' if call != 'function': raise SaltCloudSystemExit( 'The delete_disk function must be called with -f or...
Create a new persistent disk. Must specify disk_name and location and optionally can specify disk_type as pd - standard or pd - ssd which defaults to pd - standard. Can also specify an image or snapshot but if neither of those are specified a size ( in GB ) is required.
def create_disk(kwargs=None, call=None): ''' Create a new persistent disk. Must specify `disk_name` and `location`, and optionally can specify 'disk_type' as pd-standard or pd-ssd, which defaults to pd-standard. Can also specify an `image` or `snapshot` but if neither of those are specified, a `siz...
Create a new disk snapshot. Must specify name and disk_name.
def create_snapshot(kwargs=None, call=None): ''' Create a new disk snapshot. Must specify `name` and `disk_name`. CLI Example: .. code-block:: bash salt-cloud -f create_snapshot gce name=snap1 disk_name=pd ''' if call != 'function': raise SaltCloudSystemExit( 'The...
Show the details of an existing disk.
def show_disk(name=None, kwargs=None, call=None): # pylint: disable=W0613 ''' Show the details of an existing disk. CLI Example: .. code-block:: bash salt-cloud -a show_disk myinstance disk_name=mydisk salt-cloud -f show_disk gce disk_name=mydisk ''' if not kwargs or 'disk_na...
Show the details of an existing snapshot.
def show_snapshot(kwargs=None, call=None): ''' Show the details of an existing snapshot. CLI Example: .. code-block:: bash salt-cloud -f show_snapshot gce name=mysnapshot ''' if call != 'function': raise SaltCloudSystemExit( 'The show_snapshot function must be call...
Detach a disk from an instance.
def detach_disk(name=None, kwargs=None, call=None): ''' Detach a disk from an instance. CLI Example: .. code-block:: bash salt-cloud -a detach_disk myinstance disk_name=mydisk ''' if call != 'action': raise SaltCloudSystemExit( 'The detach_Disk action must be calle...
Attach an existing disk to an existing instance.
def attach_disk(name=None, kwargs=None, call=None): ''' Attach an existing disk to an existing instance. CLI Example: .. code-block:: bash salt-cloud -a attach_disk myinstance disk_name=mydisk mode=READ_WRITE ''' if call != 'action': raise SaltCloudSystemExit( 'The...
Call GCE reset on the instance.
def reboot(vm_name, call=None): ''' Call GCE 'reset' on the instance. CLI Example: .. code-block:: bash salt-cloud -a reboot myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The reboot action must be called with -a or --action.' ) conn =...
Call GCE start on the instance.
def start(vm_name, call=None): ''' Call GCE 'start on the instance. .. versionadded:: 2017.7.0 CLI Example: .. code-block:: bash salt-cloud -a start myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The start action must be called with -a or --ac...
Call GCE stop on the instance.
def stop(vm_name, call=None): ''' Call GCE 'stop' on the instance. .. versionadded:: 2017.7.0 CLI Example: .. code-block:: bash salt-cloud -a stop myinstance ''' if call != 'action': raise SaltCloudSystemExit( 'The stop action must be called with -a or --actio...
Call destroy on the instance. Can be called with - a destroy or - d
def destroy(vm_name, call=None): ''' Call 'destroy' on the instance. Can be called with "-a destroy" or -d CLI Example: .. code-block:: bash salt-cloud -a destroy myinstance1 myinstance2 ... salt-cloud -d myinstance1 myinstance2 ... ''' if call and call != 'action': r...
.. versionadded:: 2017. 7. 0
def create_attach_volumes(name, kwargs, call=None): ''' .. versionadded:: 2017.7.0 Create and attach multiple volumes to a node. The 'volumes' and 'node' arguments are required, where 'node' is a libcloud node, and 'volumes' is a list of maps, where each map contains: size The size of ...
Request a single GCE instance from a data dict.
def request_instance(vm_): ''' Request a single GCE instance from a data dict. .. versionchanged: 2017.7.0 ''' if not GCE_VM_NAME_REGEX.match(vm_['name']): raise SaltCloudSystemExit( 'VM names must start with a letter, only contain letters, numbers, or dashes ' 'and ...
Create a single GCE instance from a data dict.
def create(vm_=None, call=None): ''' Create a single GCE instance from a data dict. ''' if call: raise SaltCloudSystemExit( 'You cannot create an instance with -a or -f.' ) node_info = request_instance(vm_) if isinstance(node_info, bool): raise SaltCloudSyste...
Download most recent pricing information from GCE and save locally
def update_pricing(kwargs=None, call=None): ''' Download most recent pricing information from GCE and save locally CLI Examples: .. code-block:: bash salt-cloud -f update_pricing my-gce-config .. versionadded:: 2015.8.0 ''' url = 'https://cloudpricingcalculator.appspot.com/static...
Show pricing for a particular profile. This is only an estimate based on unofficial pricing sources.
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Examples: .. code-block:: bash salt-cloud -f show_pricing my-gce-config profile=my-profile ''' pr...
Issues HTTP queries to the logstash server.
def _logstash(url, data): ''' Issues HTTP queries to the logstash server. ''' result = salt.utils.http.query( url, 'POST', header_dict=_HEADERS, data=salt.utils.json.dumps(data), decode=True, status=True, opts=__opts__ ) return result
Listen to salt events and forward them to logstash.
def start(url, funs=None, tags=None): ''' Listen to salt events and forward them to logstash. url The Logstash endpoint. funs: ``None`` A list of functions to be compared against, looking into the ``fun`` field from the event data. This option helps to select the events ...
Ensure that the grant is present with the specified properties
def present(name, grant=None, database=None, user=None, host='localhost', grant_option=False, escape=True, revoke_first=False, ssl_option=False, **connection_args): ''' Ensure that the grant is present wi...
Ensure that the grant is absent
def absent(name, grant=None, database=None, user=None, host='localhost', grant_option=False, escape=True, **connection_args): ''' Ensure that the grant is absent name The name (key) of the grant to add grant T...
Internal cassandra nodetool wrapper. Some functions are not available via pycassa so we must rely on nodetool.
def _nodetool(cmd): ''' Internal cassandra nodetool wrapper. Some functions are not available via pycassa so we must rely on nodetool. ''' nodetool = __salt__['config.option']('cassandra.nodetool') host = __salt__['config.option']('cassandra.host') return __salt__['cmd.run_stdout']('{0} -h {...
Return a pycassa system manager connection object
def _sys_mgr(): ''' Return a pycassa system manager connection object ''' thrift_port = six.text_type(__salt__['config.option']('cassandra.THRIFT_PORT')) host = __salt__['config.option']('cassandra.host') return SystemManager('{0}:{1}'.format(host, thrift_port))
Return existing column families for all keyspaces or just the provided one.
def column_families(keyspace=None): ''' Return existing column families for all keyspaces or just the provided one. CLI Example: .. code-block:: bash salt '*' cassandra.column_families salt '*' cassandra.column_families <keyspace> ''' sys = _sys_mgr() ksps = sys.list_k...
Return a dictionary of column family definitions for the given keyspace/ column_family
def column_family_definition(keyspace, column_family): ''' Return a dictionary of column family definitions for the given keyspace/column_family CLI Example: .. code-block:: bash salt '*' cassandra.column_family_definition <keyspace> <column_family> ''' sys = _sys_mgr() try:...
Update a tenant s quota
def update_quota(self, tenant_id, subnet=None, router=None, network=None, floatingip=None, port=None, sec_grp=None, sec_grp_rule=None): ''' Update a tenant's quota ''' body = {} if subnet: body['subnet'] = subnet if ro...
Delete the specified tenant s quota value
def delete_quota(self, tenant_id): ''' Delete the specified tenant's quota value ''' ret = self.network_conn.delete_quota(tenant_id=tenant_id) return ret if ret else True
Creates a new port
def create_port(self, name, network, device_id=None, admin_state_up=True): ''' Creates a new port ''' net_id = self._find_network_id(network) body = {'admin_state_up': admin_state_up, 'name': name, 'network_id': net_id} if device_id: ...
Updates a port
def update_port(self, port, name, admin_state_up=True): ''' Updates a port ''' port_id = self._find_port_id(port) body = {'name': name, 'admin_state_up': admin_state_up} return self.network_conn.update_port(port=port_id, ...
Deletes the specified port
def delete_port(self, port): ''' Deletes the specified port ''' port_id = self._find_port_id(port) ret = self.network_conn.delete_port(port=port_id) return ret if ret else True
Creates a new network
def create_network(self, name, admin_state_up=True, router_ext=None, network_type=None, physical_network=None, segmentation_id=None, shared=None, vlan_transparent=None): ''' Creates a new network ''' body = {'name': name, 'admin_state_up': admin_state_up} if route...
Updates a network
def update_network(self, network, name): ''' Updates a network ''' net_id = self._find_network_id(network) return self.network_conn.update_network( network=net_id, body={'network': {'name': name}})
Deletes the specified network
def delete_network(self, network): ''' Deletes the specified network ''' net_id = self._find_network_id(network) ret = self.network_conn.delete_network(network=net_id) return ret if ret else True
Creates a new subnet
def create_subnet(self, network, cidr, name=None, ip_version=4): ''' Creates a new subnet ''' net_id = self._find_network_id(network) body = {'cidr': cidr, 'ip_version': ip_version, 'network_id': net_id, 'name': name} return...
Updates a subnet
def update_subnet(self, subnet, name=None): ''' Updates a subnet ''' subnet_id = self._find_subnet_id(subnet) return self.network_conn.update_subnet( subnet=subnet_id, body={'subnet': {'name': name}})
Deletes the specified subnet
def delete_subnet(self, subnet): ''' Deletes the specified subnet ''' subnet_id = self._find_subnet_id(subnet) ret = self.network_conn.delete_subnet(subnet=subnet_id) return ret if ret else True
Creates a new router
def create_router(self, name, ext_network=None, admin_state_up=True): ''' Creates a new router ''' body = {'name': name, 'admin_state_up': admin_state_up} if ext_network: net_id = self._find_network_id(ext_network) body['external_gateway_in...
Updates a router
def update_router(self, router, name=None, admin_state_up=None, **kwargs): ''' Updates a router ''' router_id = self._find_router_id(router) body = {} if 'ext_network' in kwargs: if kwargs.get('ext_network') is None: body['external_gateway_inf...
Delete the specified router
def delete_router(self, router): ''' Delete the specified router ''' router_id = self._find_router_id(router) ret = self.network_conn.delete_router(router=router_id) return ret if ret else True
Adds an internal network interface to the specified router
def add_interface_router(self, router, subnet): ''' Adds an internal network interface to the specified router ''' router_id = self._find_router_id(router) subnet_id = self._find_subnet_id(subnet) return self.network_conn.add_interface_router( router=router_id...
Adds an external network gateway to the specified router
def add_gateway_router(self, router, network): ''' Adds an external network gateway to the specified router ''' router_id = self._find_router_id(router) net_id = self._find_network_id(network) return self.network_conn.add_gateway_router( router=router_id, body...
Removes an external network gateway from the specified router
def remove_gateway_router(self, router): ''' Removes an external network gateway from the specified router ''' router_id = self._find_router_id(router) return self.network_conn.remove_gateway_router(router=router_id)
Creates a new floatingip
def create_floatingip(self, floating_network, port=None): ''' Creates a new floatingip ''' net_id = self._find_network_id(floating_network) body = {'floating_network_id': net_id} if port: port_id = self._find_port_id(port) body['port_id'] = port_id...
Updates a floatingip disassociates the floating ip if port is set to None
def update_floatingip(self, floatingip_id, port=None): ''' Updates a floatingip, disassociates the floating ip if port is set to `None` ''' if port is None: body = {'floatingip': {}} else: port_id = self._find_port_id(port) body = {'flo...
Deletes the specified floatingip
def delete_floatingip(self, floatingip_id): ''' Deletes the specified floatingip ''' ret = self.network_conn.delete_floatingip(floatingip_id) return ret if ret else True
Creates a new security group
def create_security_group(self, name, desc=None): ''' Creates a new security group ''' body = {'security_group': {'name': name, 'description': desc}} return self.network_conn.create_security_group(body=body)
Updates a security group
def update_security_group(self, sec_grp, name=None, desc=None): ''' Updates a security group ''' sec_grp_id = self._find_security_group_id(sec_grp) body = {'security_group': {}} if name: body['security_group']['name'] = name if desc: body['...
Deletes the specified security group
def delete_security_group(self, sec_grp): ''' Deletes the specified security group ''' sec_grp_id = self._find_security_group_id(sec_grp) ret = self.network_conn.delete_security_group(sec_grp_id) return ret if ret else True
Creates a new security group rule
def create_security_group_rule( self, sec_grp, remote_grp_id=None, direction='ingress', protocol=None, port_range_min=None, port_range_max=None, ether=None): ''' Creates a new security group rule ''' sec_grp_id = self._find_security_group_id(sec_grp) ...
Deletes the specified security group rule
def delete_security_group_rule(self, sec_grp_rule_id): ''' Deletes the specified security group rule ''' ret = self.network_conn.delete_security_group_rule( security_group_rule=sec_grp_rule_id) return ret if ret else True
Fetches a list of all configured VPN services for a tenant
def list_vpnservices(self, retrieve_all=True, **kwargs): ''' Fetches a list of all configured VPN services for a tenant ''' return self.network_conn.list_vpnservices(retrieve_all, **kwargs)
Fetches information of a specific VPN service
def show_vpnservice(self, vpnservice, **kwargs): ''' Fetches information of a specific VPN service ''' vpnservice_id = self._find_vpnservice_id(vpnservice) return self.network_conn.show_vpnservice(vpnservice_id, **kwargs)
Creates a new VPN service
def create_vpnservice(self, subnet, router, name, admin_state_up=True): ''' Creates a new VPN service ''' subnet_id = self._find_subnet_id(subnet) router_id = self._find_router_id(router) body = {'subnet_id': subnet_id, 'router_id': router_id, ...
Updates a VPN service
def update_vpnservice(self, vpnservice, desc): ''' Updates a VPN service ''' vpnservice_id = self._find_vpnservice_id(vpnservice) body = {'description': desc} return self.network_conn.update_vpnservice(vpnservice_id, body...
Deletes the specified VPN service
def delete_vpnservice(self, vpnservice): ''' Deletes the specified VPN service ''' vpnservice_id = self._find_vpnservice_id(vpnservice) ret = self.network_conn.delete_vpnservice(vpnservice_id) return ret if ret else True
Creates a new IPsecSiteConnection
def create_ipsec_site_connection(self, name, ipsecpolicy, ikepolicy, vpnservice, peer_cidrs, peer_address, peer_id, ...
Deletes the specified IPsecSiteConnection
def delete_ipsec_site_connection(self, ipsec_site_connection): ''' Deletes the specified IPsecSiteConnection ''' ipsec_site_connection_id = self._find_ipsec_site_connection_id( ipsec_site_connection) ret = self.network_conn.delete_ipsec_site_connection( ip...
Creates a new IKEPolicy
def create_ikepolicy(self, name, **kwargs): ''' Creates a new IKEPolicy ''' body = {'name': name} if 'phase1_negotiation_mode' in kwargs: body['phase1_negotiation_mode'] = kwargs['phase1_negotiation_mode'] if 'auth_algorithm' in kwargs: body['auth_...
Deletes the specified IKEPolicy
def delete_ikepolicy(self, ikepolicy): ''' Deletes the specified IKEPolicy ''' ikepolicy_id = self._find_ikepolicy_id(ikepolicy) ret = self.network_conn.delete_ikepolicy(ikepolicy_id) return ret if ret else True
Creates a new IPsecPolicy
def create_ipsecpolicy(self, name, **kwargs): ''' Creates a new IPsecPolicy ''' body = {'name': name} if 'transform_protocol' in kwargs: body['transform_protocol'] = kwargs['transform_protocol'] if 'auth_algorithm' in kwargs: body['auth_algorithm']...
Deletes the specified IPsecPolicy
def delete_ipsecpolicy(self, ipseecpolicy): ''' Deletes the specified IPsecPolicy ''' ipseecpolicy_id = self._find_ipsecpolicy_id(ipseecpolicy) ret = self.network_conn.delete_ipsecpolicy(ipseecpolicy_id) return ret if ret else True
Create a new firlwall rule
def create_firewall_rule(self, protocol, action, **kwargs): ''' Create a new firlwall rule ''' body = {'protocol': protocol, 'action': action} if 'tenant_id' in kwargs: body['tenant_id'] = kwargs['tenant_id'] if 'name' in kwargs: body['name'] = kwa...
Deletes the specified firewall rule
def delete_firewall_rule(self, firewall_rule): ''' Deletes the specified firewall rule ''' firewall_rule_id = self._find_firewall_rule_id(firewall_rule) ret = self.network_conn.delete_firewall_rule(firewall_rule_id) return ret if ret else True
Update a firewall rule
def update_firewall_rule(self, firewall_rule, protocol=None, action=None, name=None, description=None, ip_version=None, source_ip_address=None, destination_ip_address=None, source_port=None, destination_port=None, shared=None, enable...
Return True if the chroot environment is present.
def exist(name): ''' Return True if the chroot environment is present. ''' dev = os.path.join(name, 'dev') proc = os.path.join(name, 'proc') return all(os.path.isdir(i) for i in (name, dev, proc))
Create a basic chroot environment.
def create(name): ''' Create a basic chroot environment. Note that this environment is not functional. The caller needs to install the minimal required binaries, including Python if chroot.call is called. name Path to the chroot environment CLI Example: .. code-block:: bash ...
Executes a Salt function inside a chroot environment.
def call(name, function, *args, **kwargs): ''' Executes a Salt function inside a chroot environment. The chroot does not need to have Salt installed, but Python is required. name Path to the chroot environment function Salt execution module function CLI Example: .. c...
Save the register to <salt cachedir >/ thorium/ saves/ <name > or to an absolute path.
def save(name, filter=False): ''' Save the register to <salt cachedir>/thorium/saves/<name>, or to an absolute path. If an absolute path is specified, then the directory will be created non-recursively if it doesn't exist. USAGE: .. code-block:: yaml foo: file.save ...
Search the environment for the relative path.
def find_file(path, saltenv='base', **kwargs): ''' Search the environment for the relative path. ''' if 'env' in kwargs: # "env" is not supported; Use "saltenv". kwargs.pop('env') path = os.path.normpath(path) fnd = {'path': '', 'rel': ''} if os.path.isabs(path): ...
Return a chunk from a file based on the data received
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {'data': '', 'dest': ''} if 'path' not in load or 'loc' not in load or 'saltenv' not in load: ...
When we are asked to update ( regular interval ) lets reap the cache
def update(): ''' When we are asked to update (regular interval) lets reap the cache ''' try: salt.fileserver.reap_fileserver_cache_dir( os.path.join(__opts__['cachedir'], 'roots', 'hash'), find_file ) except (IOError, OSError): # Hash file won't exist...
Return a dict containing the file lists for files dirs emtydirs and symlinks
def _file_lists(load, form): ''' Return a dict containing the file lists for files, dirs, emtydirs and symlinks ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') saltenv = load['saltenv'] if saltenv not in __opts__['file_roots']: if '__env__'...
Return a dict of all symlinks based on a given path on the Master
def symlink_list(load): ''' Return a dict of all symlinks based on a given path on the Master ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {} if load['saltenv'] not in __opts__['file_roots'] and '__env__' not in __opts__['file_roots']: ...
Validate the beacon configuration
def validate(config): ''' Validate the beacon configuration ''' # Configuration for load beacon should be a list of dicts if not isinstance(config, list): return False, ('Configuration for load beacon must be a list.') else: _config = {} list(map(_config.update, config))...
Emit the load averages of this host.
def beacon(config): ''' Emit the load averages of this host. Specify thresholds for each load average and only emit a beacon if any of them are exceeded. `onchangeonly`: when `onchangeonly` is True the beacon will fire events only when the load average pass one threshold. Otherwise, it wi...
Calls lxd init -- auto -- opts
def init(storage_backend='dir', trust_password=None, network_address=None, network_port=None, storage_create_device=None, storage_create_loop=None, storage_pool=None): ''' Calls lxd init --auto -- opts storage_backend : Storage backend to use (zfs or dir, default: dir) trust_...
Set an LXD daemon config option
def config_set(key, value): ''' Set an LXD daemon config option CLI Examples: To listen on IPv4 and IPv6 port 8443, you can omit the :8443 its the default: .. code-block:: bash salt '*' lxd.config_set core.https_address [::]:8443 To set the server trust password: .. code-bl...
Get an LXD daemon config option
def config_get(key): ''' Get an LXD daemon config option key : The key of the config value to retrieve CLI Examples: .. code-block:: bash salt '*' lxd.config_get core.https_address ''' cmd = 'lxc config get "{0}"'.format( key ) output = __salt__['cmd.run...
Get an pyxld client this is not ment to be runned over the CLI.
def pylxd_client_get(remote_addr=None, cert=None, key=None, verify_cert=True): ''' Get an pyxld client, this is not ment to be runned over the CLI. remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address! Examples...
Saves an object ( profile/ image/ container ) and translate its execpetion on failure
def pylxd_save_object(obj): ''' Saves an object (profile/image/container) and translate its execpetion on failure obj : The object to save This is an internal method, no CLI Example. ''' try: obj.save() except pylxd.exceptions.LXDAPIException as e: raise Command...
Authenticate with a remote LXDaemon.
def authenticate(remote_addr, password, cert, key, verify_cert=True): ''' Authenticate with a remote LXDaemon. remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address! Examples: https://myserver.lan:84...
Lists containers
def container_list(list_names=False, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Lists containers list_names : False Only return a list of names when True remote_addr : An URL to a remote Server, you also have to give cert and key if you pro...
Create a container
def container_create(name, source, profiles=None, config=None, devices=None, architecture='x86_64', ephemeral=False, wait=True, remote_addr=None, cert=None, key=None, verify_cert=True, _raw=False): ''' Create a container na...
Gets a container from the LXD
def container_get(name=None, remote_addr=None, cert=None, key=None, verify_cert=True, _raw=False): ''' Gets a container from the LXD name : The name of the container to get. remote_addr : An URL to a remote Server, you also have to give cert and key if ...
Delete a container
def container_delete(name, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Delete a container name : Name of the container to delete remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its...
Rename a container
def container_rename(name, newname, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Rename a container name : Name of the container to Rename newname : The new name of the contianer remote_addr : An URL to a remote Server, you also have t...
Get container state
def container_state(name=None, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Get container state remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a TCP Address! Examples: h...
Start a container
def container_start(name, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Start a container name : Name of the container to start remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its a T...
Stop a container
def container_stop(name, timeout=30, force=True, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Stop a container name : Name of the container to stop remote_addr : An URL to a remote Server, you also have to give cert and key if you provide rem...
Restart a container
def container_restart(name, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Restart a container name : Name of the container to restart remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and...
Freeze a container
def container_freeze(name, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Freeze a container name : Name of the container to freeze remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr and its...
Unfreeze a container
def container_unfreeze(name, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Unfreeze a container name : Name of the container to unfreeze remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr...
Migrate a container.
def container_migrate(name, stop_and_start=False, remote_addr=None, cert=None, key=None, verify_cert=True, src_remote_addr=None, src_cert=None, ...
Get a container config value
def container_config_get(name, config_key, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Get a container config value name : Name of the container config_key : The config key to retrieve remote_addr : An URL to a remote Server, you ...