INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Returns a bool which defines if the requested function is authorized. Used to evaluate the standard structure under external master authentication interfaces like eauth peer peer_run etc. | def auth_check(self,
auth_list,
funs,
args,
tgt,
tgt_type='glob',
groups=None,
publish_validate=False,
minions=None,
whitelist=None):
'''
... |
Returns a list of authorisation matchers that a user is eligible for. This list is a combination of the provided personal matchers plus the matchers of any group the user is in. | def fill_auth_list_from_groups(self, auth_provider, user_groups, auth_list):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
group_nam... |
Returns a list of authorisation matchers that a user is eligible for. This list is a combination of the provided personal matchers plus the matchers of any group the user is in. | def fill_auth_list(self, auth_provider, name, groups, auth_list=None, permissive=None):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
... |
Check special API permissions | def wheel_check(self, auth_list, fun, args):
'''
Check special API permissions
'''
return self.spec_check(auth_list, fun, args, 'wheel') |
Check special API permissions | def runner_check(self, auth_list, fun, args):
'''
Check special API permissions
'''
return self.spec_check(auth_list, fun, args, 'runner') |
Check special API permissions | def spec_check(self, auth_list, fun, args, form):
'''
Check special API permissions
'''
if not auth_list:
return False
if form != 'cloud':
comps = fun.split('.')
if len(comps) != 2:
# Hint at a syntax error when command is passe... |
Check the given function name ( fun ) and its arguments ( args ) against the list of conditions. | def __fun_check(self, valid, fun, args=None, kwargs=None):
'''
Check the given function name (fun) and its arguments (args) against the list of conditions.
'''
if not isinstance(valid, list):
valid = [valid]
for cond in valid:
# Function name match
... |
valid is a dicts: { args: [... ] kwargs: {... }} or a list of such dicts. | def __args_check(self, valid, args=None, kwargs=None):
'''
valid is a dicts: {'args': [...], 'kwargs': {...}} or a list of such dicts.
'''
if not isinstance(valid, list):
valid = [valid]
for cond in valid:
if not isinstance(cond, dict):
# I... |
Return a list of the VMs that are on the provider | def list_nodes_full(call=None, for_output=True):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --function.'
)
creds = get_creds()
clc.v1.SetCredentials(... |
Return a list of the VMs that are on the provider | def get_monthly_estimate(call=None, for_output=True):
'''
Return a list of the VMs that are on the provider
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be... |
Return a list of alerts from CLC as reported by their infra | def get_server_alerts(call=None, for_output=True, **kwargs):
'''
Return a list of alerts from CLC as reported by their infra
'''
for key, value in kwargs.items():
servername = ""
if key == "servername":
servername = value
creds = get_creds()
clc.v2.SetCredentials(cred... |
Return a list of the VMs that are on the provider usage: salt - cloud - f get_group_estimate clc group = Dev location = VA1 | def get_group_estimate(call=None, for_output=True, **kwargs):
'''
Return a list of the VMs that are on the provider
usage: "salt-cloud -f get_group_estimate clc group=Dev location=VA1"
'''
for key, value in kwargs.items():
group = ""
location = ""
if key == "group":
... |
returns a list of images available to you | def avail_images(call=None):
'''
returns a list of images available to you
'''
all_servers = list_nodes_full()
templates = {}
for server in all_servers:
if server["IsTemplate"]:
templates.update({"Template Name": server["Name"]})
return templates |
returns a list of locations available to you | def avail_locations(call=None):
'''
returns a list of locations available to you
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
locations = clc.v1.Account.GetLocations()
return locations |
get the build status from CLC to make sure we dont return to early | def get_build_status(req_id, nodename):
'''
get the build status from CLC to make sure we dont return to early
'''
counter = 0
req_id = six.text_type(req_id)
while counter < 10:
queue = clc.v1.Blueprint.GetStatus(request_id=(req_id))
if queue["PercentComplete"] == 100:
... |
get the system build going | def create(vm_):
'''
get the system build going
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
cloud_profile = config.is_provider_configured(
__opts__,
__active_provider_name__ or __virtualname__,
('token',)
)
group = config.get... |
Ensure that the named service is present. | 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. | 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 | 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 | 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 | 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 | 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 | 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 | 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 ] | 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. | 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 | 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 | 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. | 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. | 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... |
Create a new REST API Service with the given name | 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:
... |
Delete all REST API Service with the given name and an optional API description | 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... |
Given rest api id return all resources for this api. | 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. | 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. | 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. | 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 | 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. | 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. | 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 | 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. | 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. | 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. | 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. | 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. | 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. | 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 | 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. | 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 | 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 in the variabl... | 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 | 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 | 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. | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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. | 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 | 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 | 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 | 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 | 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 | 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. | 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 | 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 | 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 | 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 | 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 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.