INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Show the configuration options for a given port.
def showconfig(name, default=False, dict_return=False): ''' Show the configuration options for a given port. default : False Show the default options for a port (not necessarily the same as the current configuration) dict_return : False Instead of returning the output of ``make...
Modify configuration options for a given port. Multiple options can be specified. To see the available options for a port use: mod: ports. showconfig <salt. modules. freebsdports. showconfig >.
def config(name, reset=False, **kwargs): ''' Modify configuration options for a given port. Multiple options can be specified. To see the available options for a port, use :mod:`ports.showconfig <salt.modules.freebsdports.showconfig>`. name The port name, in ``category/name`` format re...
Update the ports tree
def update(extract=False): ''' Update the ports tree extract : False If ``True``, runs a ``portsnap extract`` after fetching, should be used for first-time installation of the ports tree. CLI Example: .. code-block:: bash salt '*' ports.update ''' result = __salt_...
Lists all ports available.
def list_all(): ''' Lists all ports available. CLI Example: .. code-block:: bash salt '*' ports.list_all .. warning:: Takes a while to run, and returns a **LOT** of output ''' if 'ports.list_all' not in __context__: __context__['ports.list_all'] = [] for ...
Search for matches in the ports tree. Globs are supported and the category is optional
def search(name): ''' Search for matches in the ports tree. Globs are supported, and the category is optional CLI Examples: .. code-block:: bash salt '*' ports.search 'security/*' salt '*' ports.search 'security/n*' salt '*' ports.search nmap .. warning:: Tak...
Converts TextFSM cli_table object to list of dictionaries.
def _clitable_to_dict(objects, fsm_handler): ''' Converts TextFSM cli_table object to list of dictionaries. ''' objs = [] log.debug('Cli Table:') log.debug(objects) log.debug('FSM handler:') log.debug(fsm_handler) for row in objects: temp_dict = {} for index, element ...
r Extracts the data entities from the unstructured raw text sent as input and returns the data mapping processing using the TextFSM template.
def extract(template_path, raw_text=None, raw_text_file=None, saltenv='base'): r''' Extracts the data entities from the unstructured raw text sent as input and returns the data mapping, processing using the TextFSM template. template_path The path to the TextFSM template. This can b...
Dynamically identify the template required to extract the information from the unstructured raw text.
def index(command, platform=None, platform_grain_name=None, platform_column_name=None, output=None, output_file=None, textfsm_path=None, index_file=None, saltenv='base', include_empty=False, include_pat=None, e...
Pull the body from the request and return it
def read_body(environ): ''' Pull the body from the request and return it ''' length = environ.get('CONTENT_LENGTH', '0') length = 0 if length == '' else int(length) return environ['wsgi.input'].read(length)
Return the request body as JSON
def get_json(environ): ''' Return the request body as JSON ''' content_type = environ.get('CONTENT_TYPE', '') if content_type != 'application/json': raise HTTPError(406, 'JSON required') try: return salt.utils.json.loads(read_body(environ)) except ValueError as exc: ...
Takes the response data as well as any additional headers and returns a tuple of tuples of headers suitable for passing to start_response ()
def get_headers(data, extra_headers=None): ''' Takes the response data as well as any additional headers and returns a tuple of tuples of headers suitable for passing to start_response() ''' response_headers = { 'Content-Length': str(len(data)), } if extra_headers: response_...
Expects a list of lowstate dictionaries that are executed and returned in order
def run_chunk(environ, lowstate): ''' Expects a list of lowstate dictionaries that are executed and returned in order ''' client = environ['SALT_APIClient'] for chunk in lowstate: yield client.run(chunk)
Do any path/ method dispatching here and return a JSON - serializable data structure appropriate for the response
def dispatch(environ): ''' Do any path/method dispatching here and return a JSON-serializable data structure appropriate for the response ''' method = environ['REQUEST_METHOD'].upper() if method == 'GET': return ("They found me. I don't know how, but they found me. " "Ru...
Make Salt s opts dict and the APIClient available in the WSGI environ
def saltenviron(environ): ''' Make Salt's opts dict and the APIClient available in the WSGI environ ''' if '__opts__' not in locals(): import salt.config __opts__ = salt.config.client_config( os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master')) environ['SALT_OPT...
Process the request and return a JSON response. Catch errors and return the appropriate HTTP code.
def application(environ, start_response): ''' Process the request and return a JSON response. Catch errors and return the appropriate HTTP code. ''' # Instantiate APIClient once for the whole app saltenviron(environ) # Call the dispatcher try: resp = list(dispatch(environ)) ...
Start simple_server ()
def start(): ''' Start simple_server() ''' from wsgiref.simple_server import make_server # When started outside of salt-api __opts__ will not be injected if '__opts__' not in globals(): globals()['__opts__'] = get_opts() if __virtual__() is False: raise SystemExit(1...
Generator function for iterating through large strings particularly useful as a replacement for str. splitlines ().
def split(orig, sep=None): ''' Generator function for iterating through large strings, particularly useful as a replacement for str.splitlines(). See http://stackoverflow.com/a/3865367 ''' exp = re.compile(r'\s+' if sep is None else re.escape(sep)) pos = 0 length = len(orig) while T...
Generator that reads chunk_size bytes at a time from a file/ filehandle and yields it.
def read_file(fh_, chunk_size=1048576): ''' Generator that reads chunk_size bytes at a time from a file/filehandle and yields it. ''' try: if chunk_size != int(chunk_size): raise ValueError except ValueError: raise ValueError('chunk_size must be an integer') try: ...
Convenience function which runs fnmatch. fnmatch () on each element of passed iterable. The first matching candidate is returned or None if there is no matching candidate.
def fnmatch_multiple(candidates, pattern): ''' Convenience function which runs fnmatch.fnmatch() on each element of passed iterable. The first matching candidate is returned, or None if there is no matching candidate. ''' # Make sure that candidates is iterable to avoid a TypeError when we try t...
Translate CLI/ SLS input into the format the API expects. The translator argument must be a module containing translation functions within salt. utils. docker. translate. A skip_translate kwarg can be passed to control which arguments are translated. It can be either a comma - separated list or an iterable containing s...
def translate_input(translator, skip_translate=None, ignore_collisions=False, validate_ip_addrs=True, **kwargs): ''' Translate CLI/SLS input into the format the API expects. The ``translator`` argument must be a module containin...
Builds an IP address management ( IPAM ) config dictionary
def create_ipam_config(*pools, **kwargs): ''' Builds an IP address management (IPAM) config dictionary ''' kwargs = salt.utils.args.clean_kwargs(**kwargs) try: # docker-py 2.0 and newer pool_args = salt.utils.args.get_function_argspec( docker.types.IPAMPool.__init__).arg...
Listen to salt events and forward them to logstash
def start(host, port=5959, tag='salt/engine/logstash', proto='udp'): ''' Listen to salt events and forward them to logstash ''' if proto == 'tcp': logstashHandler = logstash.TCPLogstashHandler elif proto == 'udp': logstashHandler = logstash.UDPLogstashHandler logstash_logger = ...
Ensure an service exists and is up - to - date
def present(name, auth=None, **kwargs): ''' Ensure an service exists and is up-to-date name Name of the group type Service type enabled Boolean to control if service is enabled description An arbitrary description of the service ''' ret = {'name': name...
Ensure service does not exist
def absent(name, auth=None): ''' Ensure service does not exist name Name of the service ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['keystoneng.setup_clouds'](auth) service = __salt__['keystoneng.service_get'](n...
Return a conn object for the passed VM data
def get_conn(): ''' Return a conn object for the passed VM data ''' certificate_path = config.get_cloud_config_value( 'certificate_path', get_configured_provider(), __opts__, search_global=False ) subscription_id = salt.utils.stringutils.to_str( config.get_cloud_config_va...
List available locations for Azure
def avail_locations(conn=None, call=None): ''' List available locations for Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) if not conn: ...
List available images for Azure
def avail_images(conn=None, call=None): ''' List available images for Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must be called with ' '-f or --function, or with the --list-images option' ) if not conn: conn =...
Return a list of sizes from Azure
def avail_sizes(call=None): ''' Return a list of sizes from Azure ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the --list-sizes option' ) conn = get_conn() data = conn.list_...
List VMs on this Azure account with full information
def list_nodes_full(conn=None, call=None): ''' List VMs on this Azure account, with full information ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes_full function must be called with -f or --function.' ) if not conn: conn = get_conn() ret...
List VMs on this Azure account with full information
def list_hosted_services(conn=None, call=None): ''' List VMs on this Azure account, with full information ''' if call == 'action': raise SaltCloudSystemExit( 'The list_hosted_services function must be called with ' '-f or --function' ) if not conn: co...
Show the details from the provider concerning an instance
def show_instance(name, call=None): ''' Show the details from the provider concerning an instance ''' if call != 'action': raise SaltCloudSystemExit( 'The show_instance action must be called with -a or --action.' ) nodes = list_nodes_full() # Find under which cloud s...
Create a single VM from a data dict
def create(vm_): ''' Create a single VM from a data dict ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_name__ or 'azu...
Create and attach volumes to created node
def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True): ''' Create and attach volumes to created node ''' if call != 'action': raise SaltCloudSystemExit( 'The create_attach_volumes action must be called with ' '-a or --action.' ) if kwargs is...
Helper function for azure tests
def _wait_for_async(conn, request_id): ''' Helper function for azure tests ''' count = 0 log.debug('Waiting for asynchronous operation to complete') result = conn.get_operation_status(request_id) while result.status == 'InProgress': count = count + 1 if count > 120: ...
Destroy a VM
def destroy(name, conn=None, call=None, kwargs=None): ''' Destroy a VM CLI Examples: .. code-block:: bash salt-cloud -d myminion salt-cloud -a destroy myminion service_name=myservice ''' if call == 'function': raise SaltCloudSystemExit( 'The destroy action ...
List VMs on this Azure account with full information
def list_storage_services(conn=None, call=None): ''' List VMs on this Azure account, with full information ''' if call != 'function': raise SaltCloudSystemExit( ('The list_storage_services function must be called ' 'with -f or --function.') ) if not conn: ...
.. versionadded:: 2015. 8. 0
def get_operation_status(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Get Operation Status, based on a request ID CLI Example: .. code-block:: bash salt-cloud -f get_operation_status my-azure id=0123456789abcdef0123456789abcdef ''' if call != 'function': ...
.. versionadded:: 2015. 8. 0
def list_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List storage accounts associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_storage my-azure ''' if call != 'function': raise SaltCloudSystemExit( 'T...
.. versionadded:: 2015. 8. 0
def show_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List storage service properties CLI Example: .. code-block:: bash salt-cloud -f show_storage my-azure name=my_storage ''' if call != 'function': raise SaltCloudSystemExit( 'The...
.. versionadded:: 2015. 8. 0
def show_storage_keys(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show storage account keys CLI Example: .. code-block:: bash salt-cloud -f show_storage_keys my-azure name=my_storage ''' if call != 'function': raise SaltCloudSystemExit( ...
.. versionadded:: 2015. 8. 0
def create_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a new storage account CLI Example: .. code-block:: bash salt-cloud -f create_storage my-azure name=my_storage label=my_storage location='West US' ''' if call != 'function': raise ...
.. versionadded:: 2015. 8. 0
def update_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Update a storage account's properties CLI Example: .. code-block:: bash salt-cloud -f update_storage my-azure name=my_storage label=my_storage ''' if call != 'function': raise SaltCloudS...
.. versionadded:: 2015. 8. 0
def regenerate_storage_keys(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Regenerate storage account keys. Requires a key_type ("primary" or "secondary") to be specified. CLI Example: .. code-block:: bash salt-cloud -f regenerate_storage_keys my-azure name=my_sto...
.. versionadded:: 2015. 8. 0
def delete_storage(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific storage account CLI Examples: .. code-block:: bash salt-cloud -f delete_storage my-azure name=my_storage ''' if call != 'function': raise SaltCloudSystemExit( ...
.. versionadded:: 2015. 8. 0
def list_services(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List hosted services associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_services my-azure ''' if call != 'function': raise SaltCloudSystemExit( '...
.. versionadded:: 2015. 8. 0
def show_service(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List hosted service properties CLI Example: .. code-block:: bash salt-cloud -f show_service my-azure name=my_service ''' if call != 'function': raise SaltCloudSystemExit( 'The ...
.. versionadded:: 2015. 8. 0
def create_service(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a new hosted service CLI Example: .. code-block:: bash salt-cloud -f create_service my-azure name=my_service label=my_service location='West US' ''' if call != 'function': raise S...
.. versionadded:: 2015. 8. 0
def delete_service(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific service associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_service my-azure name=my_service ''' if call != 'function': raise SaltCloudS...
.. versionadded:: 2015. 8. 0
def list_disks(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List disks associated with the account CLI Example: .. code-block:: bash salt-cloud -f list_disks my-azure ''' if call != 'function': raise SaltCloudSystemExit( 'The list_disks f...
.. versionadded:: 2015. 8. 0
def show_disk(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a disk CLI Example: .. code-block:: bash salt-cloud -f show_disk my-azure name=my_disk ''' if call != 'function': raise SaltCloudSystemExit( 'The get_disk...
.. versionadded:: 2015. 8. 0
def cleanup_unattached_disks(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Cleans up all disks associated with the account, which are not attached. *** CAUTION *** This is a destructive function with no undo button, and no "Are you sure?" confirmation! CLI Examples: ....
.. versionadded:: 2015. 8. 0
def delete_disk(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific disk associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_disk my-azure name=my_disk salt-cloud -f delete_disk my-azure name=my_disk delete_vhd=True...
.. versionadded:: 2015. 8. 0
def update_disk(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Update a disk's properties CLI Example: .. code-block:: bash salt-cloud -f update_disk my-azure name=my_disk label=my_disk salt-cloud -f update_disk my-azure name=my_disk new_name=another_disk ...
.. versionadded:: 2015. 8. 0
def list_service_certificates(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List certificates associated with the service CLI Example: .. code-block:: bash salt-cloud -f list_service_certificates my-azure name=my_service ''' if call != 'function': rai...
.. versionadded:: 2015. 8. 0
def show_service_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a service certificate CLI Example: .. code-block:: bash salt-cloud -f show_service_certificate my-azure name=my_service_certificate \\ thumbalgorithm=sha1 ...
.. versionadded:: 2015. 8. 0
def add_service_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Add a new service certificate CLI Example: .. code-block:: bash salt-cloud -f add_service_certificate my-azure name=my_service_certificate \\ data='...CERT_DATA...' certificate_form...
.. versionadded:: 2015. 8. 0
def delete_service_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific certificate associated with the service CLI Examples: .. code-block:: bash salt-cloud -f delete_service_certificate my-azure name=my_service_certificate \\ thum...
.. versionadded:: 2015. 8. 0
def list_management_certificates(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List management certificates associated with the subscription CLI Example: .. code-block:: bash salt-cloud -f list_management_certificates my-azure name=my_management ''' if call !...
.. versionadded:: 2015. 8. 0
def show_management_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a management_certificate CLI Example: .. code-block:: bash salt-cloud -f get_management_certificate my-azure name=my_management_certificate \\ thumbalgo...
.. versionadded:: 2015. 8. 0
def add_management_certificate(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Add a new management certificate CLI Example: .. code-block:: bash salt-cloud -f add_management_certificate my-azure public_key='...PUBKEY...' \\ thumbprint=0123456789ABCDEF data...
.. versionadded:: 2015. 8. 0
def list_virtual_networks(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_virtual_networks my-azure service=myservice deployment=mydeployment ''' if call !=...
.. versionadded:: 2015. 8. 0
def list_input_endpoints(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_input_endpoints my-azure service=myservice deployment=mydeployment ''' if call != '...
.. versionadded:: 2015. 8. 0
def show_input_endpoint(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show an input endpoint associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f show_input_endpoint my-azure service=myservice \\ deployment=mydeployment name=SSH ...
.. versionadded:: 2015. 8. 0
def update_input_endpoint(kwargs=None, conn=None, call=None, activity='update'): ''' .. versionadded:: 2015.8.0 Update an input endpoint associated with the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f u...
.. versionadded:: 2015. 8. 0
def add_input_endpoint(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Add an input endpoint to the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f add_input_endpoint my-azure service=mys...
.. versionadded:: 2015. 8. 0
def delete_input_endpoint(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete an input endpoint from the deployment. Please note that there may be a delay before the changes show up. CLI Example: .. code-block:: bash salt-cloud -f delete_input_endpoint my-azure ...
.. versionadded:: 2015. 8. 0
def show_deployment(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Return information about a deployment CLI Example: .. code-block:: bash salt-cloud -f show_deployment my-azure name=my_deployment ''' if call != 'function': raise SaltCloudSystemExit( ...
.. versionadded:: 2015. 8. 0
def list_affinity_groups(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 List input endpoints associated with the deployment CLI Example: .. code-block:: bash salt-cloud -f list_affinity_groups my-azure ''' if call != 'function': raise SaltCloudSystemEx...
.. versionadded:: 2015. 8. 0
def show_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show an affinity group associated with the account CLI Example: .. code-block:: bash salt-cloud -f show_affinity_group my-azure service=myservice \\ deployment=mydeployment name=SSH ...
.. versionadded:: 2015. 8. 0
def create_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a new affinity group CLI Example: .. code-block:: bash salt-cloud -f create_affinity_group my-azure name=my_affinity_group ''' if call != 'function': raise SaltCloudSystemE...
.. versionadded:: 2015. 8. 0
def update_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Update an affinity group's properties CLI Example: .. code-block:: bash salt-cloud -f update_affinity_group my-azure name=my_group label=my_group ''' if call != 'function': raise ...
.. versionadded:: 2015. 8. 0
def delete_affinity_group(kwargs=None, conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a specific affinity group associated with the account CLI Examples: .. code-block:: bash salt-cloud -f delete_affinity_group my-azure name=my_affinity_group ''' if call != 'functio...
.. versionadded:: 2015. 8. 0
def get_storage_conn(storage_account=None, storage_key=None, conn_kwargs=None): ''' .. versionadded:: 2015.8.0 Return a storage_conn object for the storage account ''' if conn_kwargs is None: conn_kwargs = {} if not storage_account: storage_account = config.get_cloud_config_val...
.. versionadded:: 2015. 8. 0
def make_blob_url(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Creates the URL to access a blob CLI Example: .. code-block:: bash salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob container: Name of the container. blob: ...
.. versionadded:: 2015. 8. 0
def list_storage_containers(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 List containers associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f list_storage_containers my-azure ''' if call != 'function': raise Sal...
.. versionadded:: 2015. 8. 0
def create_storage_container(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Create a storage container CLI Example: .. code-block:: bash salt-cloud -f create_storage_container my-azure name=mycontainer name: Name of container to create. meta_n...
.. versionadded:: 2015. 8. 0
def show_storage_container(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show a container associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f show_storage_container my-azure name=myservice name: Name of container t...
.. versionadded:: 2015. 8. 0
def show_storage_container_metadata(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show a storage container's metadata CLI Example: .. code-block:: bash salt-cloud -f show_storage_container_metadata my-azure name=myservice name: Name of container ...
.. versionadded:: 2015. 8. 0
def set_storage_container_metadata(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Set a storage container's metadata CLI Example: .. code-block:: bash salt-cloud -f set_storage_container my-azure name=mycontainer \\ x_ms_meta_name_values='{"my_name...
.. versionadded:: 2015. 8. 0
def show_storage_container_acl(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show a storage container's acl CLI Example: .. code-block:: bash salt-cloud -f show_storage_container_acl my-azure name=myservice name: Name of existing container. l...
.. versionadded:: 2015. 8. 0
def set_storage_container_acl(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Set a storage container's acl CLI Example: .. code-block:: bash salt-cloud -f set_storage_container my-azure name=mycontainer name: Name of existing container. signed...
.. versionadded:: 2015. 8. 0
def delete_storage_container(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Delete a container associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f delete_storage_container my-azure name=mycontainer name: Name of con...
.. versionadded:: 2015. 8. 0
def lease_storage_container(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Lease a container associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f lease_storage_container my-azure name=mycontainer name: Name of contai...
.. versionadded:: 2015. 8. 0
def list_blobs(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 List blobs associated with the container CLI Example: .. code-block:: bash salt-cloud -f list_blobs my-azure container=mycontainer container: The name of the storage container prefi...
.. versionadded:: 2015. 8. 0
def show_blob_service_properties(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Show a blob's service properties CLI Example: .. code-block:: bash salt-cloud -f show_blob_service_properties my-azure ''' if call != 'function': raise SaltCloudSys...
.. versionadded:: 2015. 8. 0
def set_blob_service_properties(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Sets the properties of a storage account's Blob service, including Windows Azure Storage Analytics. You can also use this operation to set the default request version for all incoming requests...
.. versionadded:: 2015. 8. 0
def show_blob_properties(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. CLI Example: .. code-block:: bash salt-cloud -f show_blob_properties my-azure container...
.. versionadded:: 2015. 8. 0
def set_blob_properties(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Set a blob's properties CLI Example: .. code-block:: bash salt-cloud -f set_blob_properties my-azure container: Name of existing container. blob: Name of existing b...
.. versionadded:: 2015. 8. 0
def put_blob(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Upload a blob CLI Examples: .. code-block:: bash salt-cloud -f put_blob my-azure container=base name=top.sls blob_path=/srv/salt/top.sls salt-cloud -f put_blob my-azure container=base name=con...
Perform a query directly against the Azure REST API
def query(path, method='GET', data=None, params=None, header_dict=None, decode=True): ''' Perform a query directly against the Azure REST API ''' certificate_path = config.get_cloud_config_value( 'certificate_path', get_configured_provider(), __opts__, search_global=False ) subsc...
Starts service via daemontools
def start(name): ''' Starts service via daemontools CLI Example: .. code-block:: bash salt '*' daemontools.start <service name> ''' __salt__['file.remove']('{0}/down'.format(_service_path(name))) cmd = 'svc -u {0}'.format(_service_path(name)) return not __salt__['cmd.retcode']...
Stops service via daemontools
def stop(name): ''' Stops service via daemontools CLI Example: .. code-block:: bash salt '*' daemontools.stop <service name> ''' __salt__['file.touch']('{0}/down'.format(_service_path(name))) cmd = 'svc -d {0}'.format(_service_path(name)) return not __salt__['cmd.retcode'](cmd...
Send a TERM to service via daemontools
def term(name): ''' Send a TERM to service via daemontools CLI Example: .. code-block:: bash salt '*' daemontools.term <service name> ''' cmd = 'svc -t {0}'.format(_service_path(name)) return not __salt__['cmd.retcode'](cmd, python_shell=False)
Return the status for a service via daemontools return pid if running
def status(name, sig=None): ''' Return the status for a service via daemontools, return pid if running CLI Example: .. code-block:: bash salt '*' daemontools.status <service name> ''' cmd = 'svstat {0}'.format(_service_path(name)) out = __salt__['cmd.run_stdout'](cmd, python_shell...
Return True if the named service is enabled false otherwise A service is considered enabled if in your service directory: - an executable./ run file exist - a file named down does not exist
def enabled(name, **kwargs): ''' Return True if the named service is enabled, false otherwise A service is considered enabled if in your service directory: - an executable ./run file exist - a file named "down" does not exist .. versionadded:: 2015.5.7 name Service name CLI Ex...
r Check that the key is found in the registry. This refers to keys and not value/ data pairs.
def key_exists(hive, key, use_32bit_registry=False): r''' Check that the key is found in the registry. This refers to keys and not value/data pairs. Args: hive (str): The hive to connect to key (str): The key to check use_32bit_registry (bool): Look in the 32bit portion of th...
Enumerates the subkeys in a registry key or hive.
def list_keys(hive, key=None, use_32bit_registry=False): ''' Enumerates the subkeys in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER or HKCU ...
r Enumerates the values in a registry key or hive.
def list_values(hive, key=None, use_32bit_registry=False, include_default=True): r''' Enumerates the values in a registry key or hive. Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM - HKEY_CURRENT_USER ...
r Reads a registry value entry or the default value for a key. To read the default value don t pass vname
def read_value(hive, key, vname=None, use_32bit_registry=False): r''' Reads a registry value entry or the default value for a key. To read the default value, don't pass ``vname`` Args: hive (str): The name of the hive. Can be one of the following: - HKEY_LOCAL_MACHINE or HKLM ...
Sets a value in the registry. If vname is passed it will be the value for that value name otherwise it will be the default value for the specified key
def set_value(hive, key, vname=None, vdata=None, vtype='REG_SZ', use_32bit_registry=False, volatile=False): ''' Sets a value in the registry. If ``vname`` is passed, it will be the value for that value name, otherwise it wil...