INSTRUCTION stringlengths 1 46.3k | RESPONSE stringlengths 75 80.2k |
|---|---|
Ensure that the named service is present.
name
The LVS service name
protocol
The service protocol
service_address
The LVS service address
scheduler
Algorithm for allocating TCP connections and UDP datagrams to real servers.
.. code-block:: yaml
lvstest:
... | def present(name,
protocol=None,
service_address=None,
scheduler='wlc',
):
'''
Ensure that the named service is present.
name
The LVS service name
protocol
The service protocol
service_address
The LVS service address
sche... |
Ensure the LVS service is absent.
name
The name of the LVS service
protocol
The service protocol
service_address
The LVS service address | def absent(name, protocol=None, service_address=None):
'''
Ensure the LVS service is absent.
name
The name of the LVS service
protocol
The service protocol
service_address
The LVS service address
'''
ret = {'name': name,
'changes': {},
'result... |
Returns true if the passed glob matches the id | def match(tgt, opts=None):
'''
Returns true if the passed glob matches the id
'''
if not opts:
opts = __opts__
if not isinstance(tgt, six.string_types):
return False
return fnmatch.fnmatch(opts['id'], tgt) |
Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show | def show(config_file=False):
'''
Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show
'''
cmd = 'sysctl'
ret = {}
out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
for line in out.splitlines():
if no... |
Assign a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.assign net.inet.ip.forwarding 1 | def assign(name, value):
'''
Assign a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.assign net.inet.ip.forwarding 1
'''
ret = {}
cmd = 'sysctl {0}="{1}"'.format(name, value)
data = __salt__['cmd.run_all'](cmd)
# Certain values c... |
Return the configuration read from the master configuration
file or directory | def _get_asam_configuration(driver_url=''):
'''
Return the configuration read from the master configuration
file or directory
'''
asam_config = __opts__['asam'] if 'asam' in __opts__ else None
if asam_config:
try:
for asam_server, service_config in six.iteritems(asam_config)... |
To remove specified ASAM platform from the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.remove_platform my-test-vm prov1.domain.com | def remove_platform(name, server_url):
'''
To remove specified ASAM platform from the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.remove_platform my-test-vm prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return Fa... |
To list all ASAM platforms present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platforms prov1.domain.com | def list_platforms(server_url):
'''
To list all ASAM platforms present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platforms prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return False
url = confi... |
To list all ASAM platform sets present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platform_sets prov1.domain.com | def list_platform_sets(server_url):
'''
To list all ASAM platform sets present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platform_sets prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return False
... |
To add an ASAM platform using the specified ASAM platform set on the Novell
Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.add_platform my-test-vm test-platform-set prov1.domain.com | def add_platform(name, platform_set, server_url):
'''
To add an ASAM platform using the specified ASAM platform set on the Novell
Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.add_platform my-test-vm test-platform-set prov1.domain.com
'''
config = _get_asam_config... |
Create a copy of __salt__ dictionary with module.function and module[function]
Takes advantage of Jinja's syntactic sugar lookup:
.. code-block::
{{ salt.cmd.run('uptime') }} | def _split_module_dicts():
'''
Create a copy of __salt__ dictionary with module.function and module[function]
Takes advantage of Jinja's syntactic sugar lookup:
.. code-block::
{{ salt.cmd.run('uptime') }}
'''
if not isinstance(__salt__, dict):
return __salt__
mod_dict = d... |
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string | def render(template_file, saltenv='base', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline == '-s'
if not from_str and argl... |
Initialize the directories for the files | def init(**kwargs):
'''
Initialize the directories for the files
'''
formula_path = __opts__['formula_path']
pillar_path = __opts__['pillar_path']
reactor_path = __opts__['reactor_path']
for dir_ in (formula_path, pillar_path, reactor_path):
if not os.path.exists(dir_):
o... |
Check the filesystem for existing files | def check_existing(package, pkg_files, formula_def, conn=None):
'''
Check the filesystem for existing files
'''
if conn is None:
conn = init()
node_type = six.text_type(__opts__.get('spm_node_type'))
existing_files = []
for member in pkg_files:
if member.isdir():
... |
Install a single file to the file system | def install_file(package, formula_tar, member, formula_def, conn=None):
'''
Install a single file to the file system
'''
if member.name == package:
return False
if conn is None:
conn = init()
node_type = six.text_type(__opts__.get('spm_node_type'))
out_path = conn['formula... |
Remove a single file from the file system | def remove_file(path, conn=None):
'''
Remove a single file from the file system
'''
if conn is None:
conn = init()
log.debug('Removing package file %s', path)
os.remove(path) |
Get the hexdigest hash value of a file | def hash_file(path, hashobj, conn=None):
'''
Get the hexdigest hash value of a file
'''
if os.path.isdir(path):
return ''
with salt.utils.files.fopen(path, 'r') as f:
hashobj.update(salt.utils.stringutils.to_bytes(f.read()))
return hashobj.hexdigest() |
Ensure the specified policy is set
name
the name of a single policy to configure
setting
the configuration setting for the single named policy
if this argument is used the computer_policy/user_policy arguments will be ignored
policy_class
the policy class of the single nam... | def set_(name,
setting=None,
policy_class=None,
computer_policy=None,
user_policy=None,
cumulative_rights_assignments=True,
adml_language='en-US'):
'''
Ensure the specified policy is set
name
the name of a single policy to configure
setting... |
XOR definition for multiple variables | def xor(*variables):
'''
XOR definition for multiple variables
'''
sum_ = False
for value in variables:
sum_ = sum_ ^ bool(value)
return sum_ |
Return usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.usage | def usage():
'''
Return usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.usage
'''
drives = []
ret = {}
drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
for letter in UPPERCASE:
if drive_bitmask & 1:
... |
modify any key-value pair where value is a datetime object to a string. | def _convert_datetime_str(response):
'''
modify any key-value pair where value is a datetime object to a string.
'''
if response:
return dict([(k, '{0}'.format(v)) if isinstance(v, datetime.date) else (k, v) for k, v in six.iteritems(response)])
return None |
Retrieve full list of values for the contentkey from a boto3 ApiGateway
client function that may be paged via 'position' | def _multi_call(function, contentkey, *args, **kwargs):
'''
Retrieve full list of values for the contentkey from a boto3 ApiGateway
client function that may be paged via 'position'
'''
ret = function(*args, **kwargs)
position = ret.get('position')
while position:
more = function(*ar... |
get and return list of matching rest api information by the given name and desc.
If rest api name evaluates to False, return all apis w/o filtering the name. | def _find_apis_by_name(name, description=None,
region=None, key=None, keyid=None, profile=None):
'''
get and return list of matching rest api information by the given name and desc.
If rest api name evaluates to False, return all apis w/o filtering the name.
'''
try:
c... |
Returns all rest apis in the defined region. If optional parameter name is included,
returns all rest apis matching the name in the defined region.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_apis
salt myminion boto_apigateway.describe_apis name='api name'
... | def describe_apis(name=None, description=None, region=None, key=None, keyid=None, profile=None):
'''
Returns all rest apis in the defined region. If optional parameter name is included,
returns all rest apis matching the name in the defined region.
CLI Example:
.. code-block:: bash
salt ... |
Check to see if the given Rest API Name and optionally description exists.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.exists myapi_name | def api_exists(name, description=None, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given Rest API Name and optionally description exists.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.exists myapi_name
'''
apis = _find_apis_by_name(name... |
Delete all REST API Service with the given name and an optional API description
Returns {deleted: True, count: deleted_count} if apis were deleted, and
returns {deleted: False} if error or not found.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api myapi_name
... | def delete_api(name, description=None, region=None, key=None, keyid=None, profile=None):
'''
Delete all REST API Service with the given name and an optional API description
Returns {deleted: True, count: deleted_count} if apis were deleted, and
returns {deleted: False} if error or not found.
CLI E... |
Create a new REST API Service with the given name
Returns {created: True} if the rest api was created and returns
{created: False} if the rest api was not created.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api myapi_name api_description | def create_api(name, description, cloneFrom=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a new REST API Service with the given name
Returns {created: True} if the rest api was created and returns
{created: False} if the rest api was not created.
CLI Example:
... |
Given rest api id, return all resources for this api.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resources myapi_id | def describe_api_resources(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, return all resources for this api.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resources myapi_id
'''
try:
conn = _get_conn(region=r... |
Given rest api id, and an absolute resource path, returns the resource id for
the given path.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resource myapi_id resource_path | def describe_api_resource(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, and an absolute resource path, returns the resource id for
the given path.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe... |
Given rest api id, and an absolute resource path, create all the resources and
return all resources in the resourcepath, returns False on failure.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_resources myapi_id resource_path | def create_api_resources(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, and an absolute resource path, create all the resources and
return all resources in the resourcepath, returns False on failure.
CLI Example:
.. code-block:: b... |
Given restApiId and an absolute resource path, delete the resources starting
from the absolute resource path. If resourcepath is the root resource '/',
the function will return False. Returns False on failure.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_resource... | def delete_api_resources(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given restApiId and an absolute resource path, delete the resources starting
from the absolute resource path. If resourcepath is the root resource '/',
the function will return False.... |
Gets info about the given api key
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_key apigw_api_key | def describe_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Gets info about the given api key
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_key apigw_api_key
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, p... |
Gets information about the defined API Keys. Return list of apiKeys.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_keys | def describe_api_keys(region=None, key=None, keyid=None, profile=None):
'''
Gets information about the defined API Keys. Return list of apiKeys.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_keys
'''
try:
conn = _get_conn(region=region, key=key... |
Create an API key given name and description.
An optional enabled argument can be provided. If provided, the
valid values are True|False. This argument defaults to True.
An optional stageKeys argument can be provided in the form of
list of dictionary with 'restApiId' and 'stageName' as keys.
CL... | def create_api_key(name, description, enabled=True, stageKeys=None,
region=None, key=None, keyid=None, profile=None):
'''
Create an API key given name and description.
An optional enabled argument can be provided. If provided, the
valid values are True|False. This argument defaults... |
Deletes a given apiKey
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_key apikeystring | def delete_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Deletes a given apiKey
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_key apikeystring
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... |
the replace patch operation on an ApiKey resource | def _api_key_patch_replace(conn, apiKey, path, value):
'''
the replace patch operation on an ApiKey resource
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=[{'op': 'replace', 'path': path, 'value': value}])
return response |
the add patch operation for a list of (path, value) tuples on an ApiKey resource list path | def _api_key_patch_add(conn, apiKey, pvlist):
'''
the add patch operation for a list of (path, value) tuples on an ApiKey resource list path
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=_api_key_patchops('add', pvlist))
return response |
the remove patch operation for a list of (path, value) tuples on an ApiKey resource list path | def _api_key_patch_remove(conn, apiKey, pvlist):
'''
the remove patch operation for a list of (path, value) tuples on an ApiKey resource list path
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=_api_key_patchops('remove', pvlist))
return response |
update the given apiKey with the given description.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_key_description api_key description | def update_api_key_description(apiKey, description, region=None, key=None, keyid=None, profile=None):
'''
update the given apiKey with the given description.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_key_description api_key description
'''
try:
... |
enable the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.enable_api_key api_key | def enable_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
enable the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.enable_api_key api_key
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... |
associate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.associate_stagekeys_api_key \\
api_key '["restapi id/stage name", ...]' | def associate_api_key_stagekeys(apiKey, stagekeyslist, region=None, key=None, keyid=None, profile=None):
'''
associate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.associate_stagekeys_api_key \\
api_key '["restapi... |
disassociate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.disassociate_stagekeys_api_key \\
api_key '["restapi id/stage name", ...]' | def disassociate_api_key_stagekeys(apiKey, stagekeyslist, region=None, key=None, keyid=None, profile=None):
'''
disassociate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.disassociate_stagekeys_api_key \\
api_key '... |
Gets information about the defined API Deployments. Return list of api deployments.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployments restApiId | def describe_api_deployments(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Gets information about the defined API Deployments. Return list of api deployments.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployments restApiId
'''
tr... |
Get API deployment for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployent restApiId deploymentId | def describe_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Get API deployment for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployent restApiId deploymentId
'''
try:... |
Activates previously deployed deployment for a given stage
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.activate_api_deployent restApiId stagename deploymentId | def activate_api_deployment(restApiId, stageName, deploymentId,
region=None, key=None, keyid=None, profile=None):
'''
Activates previously deployed deployment for a given stage
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.activate_api_deployent r... |
Creates a new API deployment.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_deployent restApiId stagename stageDescription='' \\
description='' cacheClusterEnabled=True|False cacheClusterSize=0.5 variables='{"name": "value"}' | def create_api_deployment(restApiId, stageName, stageDescription='', description='', cacheClusterEnabled=False,
cacheClusterSize='0.5', variables=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates a new API deployment.
CLI Example:
.... |
Deletes API deployment for a given restApiId and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_deployent restApiId deploymentId | def delete_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Deletes API deployment for a given restApiId and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_deployent restApiId deploymentId
'''
try:
... |
Overwrite the stage variables for the given restApiId and stage name with the given variables,
variables must be in the form of a dictionary. Overwrite will always remove all the existing
stage variables associated with the given restApiId and stage name, follow by the adding of all the
variables specified... | def overwrite_api_stage_variables(restApiId, stageName, variables, region=None, key=None, keyid=None, profile=None):
'''
Overwrite the stage variables for the given restApiId and stage name with the given variables,
variables must be in the form of a dictionary. Overwrite will always remove all the existin... |
Get API stage for a given apiID and stage name
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stage restApiId stageName | def describe_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Get API stage for a given apiID and stage name
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stage restApiId stageName
'''
try:
conn = _get_conn(r... |
Get all API stages for a given apiID and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stages restApiId deploymentId | def describe_api_stages(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Get all API stages for a given apiID and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stages restApiId deploymentId
'''
try:
con... |
Creates a new API stage for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_stage restApiId stagename deploymentId \\
description='' cacheClusterEnabled=True|False cacheClusterSize='0.5' variables='{"name": "value"}' | def create_api_stage(restApiId, stageName, deploymentId, description='',
cacheClusterEnabled=False, cacheClusterSize='0.5', variables=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates a new API stage for a given restApiId and deploymentId.
CLI Exa... |
Deletes stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_stage restApiId stageName | def delete_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Deletes stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_stage restApiId stageName
'''
try:
... |
Flushes cache for the stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName | def flush_api_stage_cache(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Flushes cache for the stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName
... |
Creates API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_method restApiId resourcePath, httpMethod, authorizationType, \\
apiKeyRequired=False, requestParameters='{"name", "value"}', requestModels='{"content-type", "valu... | def create_api_method(restApiId, resourcePath, httpMethod, authorizationType,
apiKeyRequired=False, requestParameters=None, requestModels=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates API method for a resource in the given API
CLI Example:
... |
Get API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod | def describe_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Get API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod
'''
... |
Delete API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod | def delete_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Delete API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod
'''
t... |
Create API method response for a method on a given resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_method_response restApiId resourcePath httpMethod \\
statusCode responseParameters='{"name", "True|False"}' responseModels='{"content-... | def create_api_method_response(restApiId, resourcePath, httpMethod, statusCode, responseParameters=None,
responseModels=None, region=None, key=None, keyid=None, profile=None):
'''
Create API method response for a method on a given resource in the given API
CLI Example:
.... |
Delete API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method_response restApiId resourcePath httpMethod statusCode | def delete_api_method_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Delete API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delet... |
Get API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method_response restApiId resourcePath httpMethod statusCode | def describe_api_method_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Get API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.desc... |
Get all models for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_models restApiId | def describe_api_models(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Get all models for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_models restApiId
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid,... |
Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True] | def describe_api_model(restApiId, modelName, flatten=True, region=None, key=None, keyid=None, profile=None):
'''
Get a model by name for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_model restApiId modelName [True]
'''
try:
conn = _... |
Check to see if the given modelName exists in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.api_model_exists restApiId modelName | def api_model_exists(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given modelName exists in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.api_model_exists restApiId modelName
'''
r = describe_api_... |
the replace patch operation on a Model resource | def _api_model_patch_replace(conn, restApiId, modelName, path, value):
'''
the replace patch operation on a Model resource
'''
response = conn.update_model(restApiId=restApiId, modelName=modelName,
patchOperations=[{'op': 'replace', 'path': path, 'value': value}])
re... |
update the schema (in python dictionary format) for the given model in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_model_schema restApiId modelName schema | def update_api_model_schema(restApiId, modelName, schema, region=None, key=None, keyid=None, profile=None):
'''
update the schema (in python dictionary format) for the given model in the given restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_model_schema re... |
Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName | def delete_api_model(restApiId, modelName, region=None, key=None, keyid=None, profile=None):
'''
Delete a model identified by name in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_model restApiId modelName
'''
try:
conn = _get_conn(reg... |
Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_model restApiId modelName modelDescription '<schema>' 'content-type' | def create_api_model(restApiId, modelName, modelDescription, schema, contentType='application/json',
region=None, key=None, keyid=None, profile=None):
'''
Create a new model in a given API with a given schema, currently only contentType supported is
'application/json'
CLI Example:
... |
Get an integration for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMethod | def describe_api_integration(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Get an integration for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration restApiId resourcePath httpMeth... |
Get an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_integration_response restApiId resourcePath httpMethod statusCode | def describe_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Get an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... |
Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_integration_response restApiId resourcePath httpMethod statusCode | def delete_api_integration_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Deletes an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto... |
Creates an integration for a given method in a given API.
If integrationType is MOCK, uri and credential parameters will be ignored.
uri is in the form of (substitute APIGATEWAY_REGION and LAMBDA_FUNC_ARN)
"arn:aws:apigateway:APIGATEWAY_REGION:lambda:path/2015-03-31/functions/LAMBDA_FUNC_ARN/invocations"
... | def create_api_integration(restApiId, resourcePath, httpMethod, integrationType, integrationHttpMethod,
uri, credentials, requestParameters=None, requestTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration for a given ... |
Creates an integration response for a given method in a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_integration_response restApiId resourcePath httpMethod \\
statusCode selectionPattern ['{}' ['{}']] | def create_api_integration_response(restApiId, resourcePath, httpMethod, statusCode, selectionPattern,
responseParameters=None, responseTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration response fo... |
Helper to return list of usage plan items matching the given attribute value. | def _filter_plans(attr, name, plans):
'''
Helper to return list of usage plan items matching the given attribute value.
'''
return [plan for plan in plans if plan[attr] == name] |
Returns a list of existing usage plans, optionally filtered to match a given plan name
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_usage_plans
salt myminion boto_apigateway.describe_usage_plans name='usage plan name'
salt my... | def describe_usage_plans(name=None, plan_id=None, region=None, key=None, keyid=None, profile=None):
'''
Returns a list of existing usage plans, optionally filtered to match a given plan name
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.descri... |
Helper to verify that quota parameters are valid | def _validate_quota(quota):
'''
Helper to verify that quota parameters are valid
'''
if quota is not None:
if not isinstance(quota, dict):
raise TypeError('quota must be a dictionary, provided value: {0}'.format(quota))
periods = ['DAY', 'WEEK', 'MONTH']
if 'period' n... |
Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consisting of the following keys:
rateLimit
requests per second at steady rate, float
burstLimit
ma... | def create_usage_plan(name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Creates a new usage plan with throttling and quotas optionally applied
.. versionadded:: 2017.7.0
name
Name of the usage plan
throttle
A dictionary consis... |
Updates an existing usage plan with throttling and quotas
.. versionadded:: 2017.7.0
plan_id
Id of the created usage plan
throttle
A dictionary consisting of the following keys:
rateLimit
requests per second at steady rate, float
burstLimit
maximu... | def update_usage_plan(plan_id, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
'''
Updates an existing usage plan with throttling and quotas
.. versionadded:: 2017.7.0
plan_id
Id of the created usage plan
throttle
A dictionary consisting of the followi... |
Deletes usage plan identified by plan_id
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id' | def delete_usage_plan(plan_id, region=None, key=None, keyid=None, profile=None):
'''
Deletes usage plan identified by plan_id
.. versionadded:: 2017.7.0
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_usage_plan plan_id='usage plan id'
'''
try:
exi... |
Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway... | def _update_usage_plan_apis(plan_id, apis, op, region=None, key=None, keyid=None, profile=None):
'''
Helper function that updates the usage plan identified by plan_id by adding or removing it to each of the stages, specified by apis parameter.
apis
a list of dictionaries, where each dictionary cont... |
Attaches given usage plan to each of the apis provided in a list of apiId and stage values
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway
stage
... | def attach_usage_plan_to_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
Attaches given usage plan to each of the apis provided in a list of apiId and stage values
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
... |
Detaches given usage plan from each of the apis provided in a list of apiId and stage value
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:
apiId
a string, which is the id of the created API in AWS ApiGateway
stage
... | def detach_usage_plan_from_apis(plan_id, apis, region=None, key=None, keyid=None, profile=None):
'''
Detaches given usage plan from each of the apis provided in a list of apiId and stage value
.. versionadded:: 2017.7.0
apis
a list of dictionaries, where each dictionary contains the following:... |
Return a simple vdev tree from zpool.status' config section | def _clean_vdev_config(config):
'''
Return a simple vdev tree from zpool.status' config section
'''
cln_config = OrderedDict()
for label, sub_config in config.items():
if label not in ['state', 'read', 'write', 'cksum']:
sub_config = _clean_vdev_config(sub_config)
if... |
Return the status of the named zpool
zpool : string
optional name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.status myzpool | def status(zpool=None):
'''
Return the status of the named zpool
zpool : string
optional name of storage pool
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.status myzpool
'''
ret = OrderedDict()
## collect status output
res = _... |
Display I/O statistics for the given pools
zpool : string
optional name of storage pool
sample_time : int
seconds to capture data before output
default a sample of 5 seconds is used
parsable : boolean
display data in pythonc values (True, False, Bytes,...)
.. versionad... | def iostat(zpool=None, sample_time=5, parsable=True):
'''
Display I/O statistics for the given pools
zpool : string
optional name of storage pool
sample_time : int
seconds to capture data before output
default a sample of 5 seconds is used
parsable : boolean
display... |
.. versionadded:: 2015.5.0
Return information about (all) storage pools
zpool : string
optional name of storage pool
properties : string
comma-separated list of properties to list
parsable : boolean
display numbers in parsable (exact) values
.. versionadded:: 2018.3.... | def list_(properties='size,alloc,free,cap,frag,health', zpool=None, parsable=True):
'''
.. versionadded:: 2015.5.0
Return information about (all) storage pools
zpool : string
optional name of storage pool
properties : string
comma-separated list of properties to list
parsable... |
.. versionadded:: 2016.3.0
Retrieves the given list of properties
zpool : string
Name of storage pool
prop : string
Optional name of property to retrieve
show_source : boolean
Show source of property
parsable : boolean
Display numbers in parsable (exact) values
... | def get(zpool, prop=None, show_source=False, parsable=True):
'''
.. versionadded:: 2016.3.0
Retrieves the given list of properties
zpool : string
Name of storage pool
prop : string
Optional name of property to retrieve
show_source : boolean
Show source of property
... |
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool | def exists(zpool):
'''
Check if a ZFS storage pool is active
zpool : string
Name of storage pool
CLI Example:
.. code-block:: bash
salt '*' zpool.exists myzpool
'''
# list for zpool
# NOTE: retcode > 0 if zpool does not exists
res = __salt__['cmd.run_all'](
... |
Sets the given property on the specified pool
zpool : string
Name of storage pool
prop : string
Name of property to set
value : string
Value to set for the specified property
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' zpool.set my... | def set(zpool, prop, value):
'''
Sets the given property on the specified pool
zpool : string
Name of storage pool
prop : string
Name of property to set
value : string
Value to set for the specified property
.. versionadded:: 2016.3.0
CLI Example:
.. code-bl... |
Destroys a storage pool
zpool : string
Name of storage pool
force : boolean
Force destroy of pool
CLI Example:
.. code-block:: bash
salt '*' zpool.destroy myzpool | def destroy(zpool, force=False):
'''
Destroys a storage pool
zpool : string
Name of storage pool
force : boolean
Force destroy of pool
CLI Example:
.. code-block:: bash
salt '*' zpool.destroy myzpool
'''
# destroy zpool
res = __salt__['cmd.run_all'](
... |
Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pause is only available on recent versions of ZFS.
... | def scrub(zpool, stop=False, pause=False):
'''
Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pau... |
.. versionadded:: 2015.5.0
Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3
zpool : string
Name of storage pool
vdevs : string
One or move devices
force : boolean
... | def create(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Create a simple zpool, a mirrored zpool, a zpool having nested VDEVs, a hybrid zpool with cache, spare and log drives or a zpool with RAIDZ-1, RAIDZ-2 or RAIDZ-3
zpool : string
Name of storage pool
vdevs : string
... |
Add the specified vdev\'s to the given storage pool
zpool : string
Name of storage pool
vdevs : string
One or more devices
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
salt '*' zpool.add myzpool /path/to/vdev1 /path/to/vdev2 [...] | def add(zpool, *vdevs, **kwargs):
'''
Add the specified vdev\'s to the given storage pool
zpool : string
Name of storage pool
vdevs : string
One or more devices
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
salt '*' zpool.add myz... |
Attach specified device to zpool
zpool : string
Name of storage pool
device : string
Existing device name too
new_device : string
New device name (to be attached to ``device``)
force : boolean
Forces use of device
CLI Example:
.. code-block:: bash
s... | def attach(zpool, device, new_device, force=False):
'''
Attach specified device to zpool
zpool : string
Name of storage pool
device : string
Existing device name too
new_device : string
New device name (to be attached to ``device``)
force : boolean
Forces use ... |
Detach specified device to zpool
zpool : string
Name of storage pool
device : string
Device to detach
CLI Example:
.. code-block:: bash
salt '*' zpool.detach myzpool /path/to/vdev1 | def detach(zpool, device):
'''
Detach specified device to zpool
zpool : string
Name of storage pool
device : string
Device to detach
CLI Example:
.. code-block:: bash
salt '*' zpool.detach myzpool /path/to/vdev1
'''
## Update storage pool
res = __salt__[... |
.. versionadded:: 2018.3.0
Splits devices off pool creating newpool.
.. note::
All vdevs in pool must be mirrors. At the time of the split,
``newzpool`` will be a replica of ``zpool``.
After splitting, do not forget to import the new pool!
zpool : string
Name of storage... | def split(zpool, newzpool, **kwargs):
'''
.. versionadded:: 2018.3.0
Splits devices off pool creating newpool.
.. note::
All vdevs in pool must be mirrors. At the time of the split,
``newzpool`` will be a replica of ``zpool``.
After splitting, do not forget to import the new... |
Replaces ``old_device`` with ``new_device``
.. note::
This is equivalent to attaching ``new_device``,
waiting for it to resilver, and then detaching ``old_device``.
The size of ``new_device`` must be greater than or equal to the minimum
size of all the devices in a mirror or raidz... | def replace(zpool, old_device, new_device=None, force=False):
'''
Replaces ``old_device`` with ``new_device``
.. note::
This is equivalent to attaching ``new_device``,
waiting for it to resilver, and then detaching ``old_device``.
The size of ``new_device`` must be greater than or... |
Creates file based virtual devices for a zpool
CLI Example:
.. code-block:: bash
salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]
.. note::
Depending on file size, the above command may take a while to return. | def create_file_vdev(size, *vdevs):
'''
Creates file based virtual devices for a zpool
CLI Example:
.. code-block:: bash
salt '*' zpool.create_file_vdev 7G /path/to/vdev1 [/path/to/vdev2] [...]
.. note::
Depending on file size, the above command may take a while to return.
... |
.. versionadded:: 2015.5.0
Export storage pools
pools : string
One or more storage pools to export
force : boolean
Force export of storage pools
CLI Example:
.. code-block:: bash
salt '*' zpool.export myzpool ... [force=True|False]
salt '*' zpool.export myzpool2... | def export(*pools, **kwargs):
'''
.. versionadded:: 2015.5.0
Export storage pools
pools : string
One or more storage pools to export
force : boolean
Force export of storage pools
CLI Example:
.. code-block:: bash
salt '*' zpool.export myzpool ... [force=True|Fal... |
.. versionadded:: 2015.5.0
Import storage pools or list pools available for import
zpool : string
Optional name of storage pool
new_name : string
Optional new name for the storage pool
mntopts : string
Comma-separated list of mount options to use when mounting datasets
... | def import_(zpool=None, new_name=None, **kwargs):
'''
.. versionadded:: 2015.5.0
Import storage pools or list pools available for import
zpool : string
Optional name of storage pool
new_name : string
Optional new name for the storage pool
mntopts : string
Comma-separa... |
.. versionadded:: 2015.5.0
Ensure that the specified devices are online
zpool : string
name of storage pool
vdevs : string
one or more devices
expand : boolean
Expand the device to use all available space.
.. note::
If the device is part of a mirror or r... | def online(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Ensure that the specified devices are online
zpool : string
name of storage pool
vdevs : string
one or more devices
expand : boolean
Expand the device to use all available space.
.. note::
... |
.. versionadded:: 2015.5.0
Ensure that the specified devices are offline
.. warning::
By default, the ``OFFLINE`` state is persistent. The device remains
offline when the system is rebooted. To temporarily take a device
offline, use ``temporary=True``.
zpool : string
name... | def offline(zpool, *vdevs, **kwargs):
'''
.. versionadded:: 2015.5.0
Ensure that the specified devices are offline
.. warning::
By default, the ``OFFLINE`` state is persistent. The device remains
offline when the system is rebooted. To temporarily take a device
offline, use ``... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.