repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/libcloud_dns.py | create_record | def create_record(name, zone_id, type, data, profile):
'''
Create a new record.
:param name: Record name without the domain name (e.g. www).
Note: If you want to create a record for a base domain
name, you should specify empty string ('') for this
argument... | python | def create_record(name, zone_id, type, data, profile):
'''
Create a new record.
:param name: Record name without the domain name (e.g. www).
Note: If you want to create a record for a base domain
name, you should specify empty string ('') for this
argument... | [
"def",
"create_record",
"(",
"name",
",",
"zone_id",
",",
"type",
",",
"data",
",",
"profile",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"record_type",
"=",
"_string_to_record_type",
"(",
"type",
")",
"zone",
"=",
"conn",
... | Create a new record.
:param name: Record name without the domain name (e.g. www).
Note: If you want to create a record for a base domain
name, you should specify empty string ('') for this
argument.
:type name: ``str``
:param zone_id: Zone where the requ... | [
"Create",
"a",
"new",
"record",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L247-L278 | train | Create a new DNS record. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/libcloud_dns.py | delete_zone | def delete_zone(zone_id, profile):
'''
Delete a zone.
:param zone_id: Zone to delete.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:rtype: ``bool``
CLI Example:
.. code-block:: bash
salt myminion libcloud_dns.delete_zone google.com pro... | python | def delete_zone(zone_id, profile):
'''
Delete a zone.
:param zone_id: Zone to delete.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:rtype: ``bool``
CLI Example:
.. code-block:: bash
salt myminion libcloud_dns.delete_zone google.com pro... | [
"def",
"delete_zone",
"(",
"zone_id",
",",
"profile",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"zone",
"=",
"conn",
".",
"get_zone",
"(",
"zone_id",
"=",
"zone_id",
")",
"return",
"conn",
".",
"delete_zone",
"(",
"zone",... | Delete a zone.
:param zone_id: Zone to delete.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:rtype: ``bool``
CLI Example:
.. code-block:: bash
salt myminion libcloud_dns.delete_zone google.com profile1 | [
"Delete",
"a",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L281-L301 | train | Delete a zone. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/libcloud_dns.py | delete_record | def delete_record(zone_id, record_id, profile):
'''
Delete a record.
:param zone_id: Zone to delete.
:type zone_id: ``str``
:param record_id: Record to delete.
:type record_id: ``str``
:param profile: The profile key
:type profile: ``str``
:rtype: ``bool``
CLI Example:
... | python | def delete_record(zone_id, record_id, profile):
'''
Delete a record.
:param zone_id: Zone to delete.
:type zone_id: ``str``
:param record_id: Record to delete.
:type record_id: ``str``
:param profile: The profile key
:type profile: ``str``
:rtype: ``bool``
CLI Example:
... | [
"def",
"delete_record",
"(",
"zone_id",
",",
"record_id",
",",
"profile",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"record",
"=",
"conn",
".",
"get_record",
"(",
"zone_id",
"=",
"zone_id",
",",
"record_id",
"=",
"record_id... | Delete a record.
:param zone_id: Zone to delete.
:type zone_id: ``str``
:param record_id: Record to delete.
:type record_id: ``str``
:param profile: The profile key
:type profile: ``str``
:rtype: ``bool``
CLI Example:
.. code-block:: bash
salt myminion libcloud_dns.... | [
"Delete",
"a",
"record",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L304-L327 | train | Delete a record. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/libcloud_dns.py | get_bind_data | def get_bind_data(zone_id, profile):
'''
Export Zone to the BIND compatible format.
:param zone_id: Zone to export.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:return: Zone data in BIND compatible format.
:rtype: ``str``
CLI Example:
.. c... | python | def get_bind_data(zone_id, profile):
'''
Export Zone to the BIND compatible format.
:param zone_id: Zone to export.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:return: Zone data in BIND compatible format.
:rtype: ``str``
CLI Example:
.. c... | [
"def",
"get_bind_data",
"(",
"zone_id",
",",
"profile",
")",
":",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"zone",
"=",
"conn",
".",
"get_zone",
"(",
"zone_id",
")",
"return",
"conn",
".",
"export_zone_to_bind_format",
"(",
"zone",
... | Export Zone to the BIND compatible format.
:param zone_id: Zone to export.
:type zone_id: ``str``
:param profile: The profile key
:type profile: ``str``
:return: Zone data in BIND compatible format.
:rtype: ``str``
CLI Example:
.. code-block:: bash
salt myminion libcloud_... | [
"Export",
"Zone",
"to",
"the",
"BIND",
"compatible",
"format",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L330-L351 | train | Get the zone data in BIND compatible format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/libcloud_dns.py | extra | def extra(method, profile, **libcloud_kwargs):
'''
Call an extended method on the driver
:param method: Driver's method name
:type method: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_container method
... | python | def extra(method, profile, **libcloud_kwargs):
'''
Call an extended method on the driver
:param method: Driver's method name
:type method: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_container method
... | [
"def",
"extra",
"(",
"method",
",",
"profile",
",",
"*",
"*",
"libcloud_kwargs",
")",
":",
"_sanitize_kwargs",
"(",
"libcloud_kwargs",
")",
"conn",
"=",
"_get_driver",
"(",
"profile",
"=",
"profile",
")",
"connection_method",
"=",
"getattr",
"(",
"conn",
","... | Call an extended method on the driver
:param method: Driver's method name
:type method: ``str``
:param profile: The profile key
:type profile: ``str``
:param libcloud_kwargs: Extra arguments for the driver's delete_container method
:type libcloud_kwargs: ``dict``
CLI Example:
.. ... | [
"Call",
"an",
"extended",
"method",
"on",
"the",
"driver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L354-L376 | train | A simple method to call an extended method on the driver s delete_container | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/libcloud_dns.py | _string_to_record_type | def _string_to_record_type(string):
'''
Return a string representation of a DNS record type to a
libcloud RecordType ENUM.
:param string: A record type, e.g. A, TXT, NS
:type string: ``str``
:rtype: :class:`RecordType`
'''
string = string.upper()
record_type = getattr(RecordType, ... | python | def _string_to_record_type(string):
'''
Return a string representation of a DNS record type to a
libcloud RecordType ENUM.
:param string: A record type, e.g. A, TXT, NS
:type string: ``str``
:rtype: :class:`RecordType`
'''
string = string.upper()
record_type = getattr(RecordType, ... | [
"def",
"_string_to_record_type",
"(",
"string",
")",
":",
"string",
"=",
"string",
".",
"upper",
"(",
")",
"record_type",
"=",
"getattr",
"(",
"RecordType",
",",
"string",
")",
"return",
"record_type"
] | Return a string representation of a DNS record type to a
libcloud RecordType ENUM.
:param string: A record type, e.g. A, TXT, NS
:type string: ``str``
:rtype: :class:`RecordType` | [
"Return",
"a",
"string",
"representation",
"of",
"a",
"DNS",
"record",
"type",
"to",
"a",
"libcloud",
"RecordType",
"ENUM",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/libcloud_dns.py#L379-L391 | train | Converts a string representation of a DNS record type to libcloud RecordType ENUM. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/ifttt.py | _query | def _query(event=None,
method='GET',
args=None,
header_dict=None,
data=None):
'''
Make a web call to IFTTT.
'''
secret_key = __salt__['config.get']('ifttt.secret_key') or \
__salt__['config.get']('ifttt:secret_key')
path = 'https://maker.ifttt.com/... | python | def _query(event=None,
method='GET',
args=None,
header_dict=None,
data=None):
'''
Make a web call to IFTTT.
'''
secret_key = __salt__['config.get']('ifttt.secret_key') or \
__salt__['config.get']('ifttt:secret_key')
path = 'https://maker.ifttt.com/... | [
"def",
"_query",
"(",
"event",
"=",
"None",
",",
"method",
"=",
"'GET'",
",",
"args",
"=",
"None",
",",
"header_dict",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"secret_key",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'ifttt.secret_key'",
... | Make a web call to IFTTT. | [
"Make",
"a",
"web",
"call",
"to",
"IFTTT",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ifttt.py#L37-L70 | train | Make a web call to IFTTT. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/ifttt.py | trigger_event | def trigger_event(event=None, **kwargs):
'''
Trigger a configured event in IFTTT.
:param event: The name of the event to trigger.
:return: A dictionary with status, text, and error if result was failure.
'''
res = {'result': False, 'message': 'Something went wrong'}
data = {}
... | python | def trigger_event(event=None, **kwargs):
'''
Trigger a configured event in IFTTT.
:param event: The name of the event to trigger.
:return: A dictionary with status, text, and error if result was failure.
'''
res = {'result': False, 'message': 'Something went wrong'}
data = {}
... | [
"def",
"trigger_event",
"(",
"event",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"res",
"=",
"{",
"'result'",
":",
"False",
",",
"'message'",
":",
"'Something went wrong'",
"}",
"data",
"=",
"{",
"}",
"for",
"value",
"in",
"(",
"'value1'",
",",
... | Trigger a configured event in IFTTT.
:param event: The name of the event to trigger.
:return: A dictionary with status, text, and error if result was failure. | [
"Trigger",
"a",
"configured",
"event",
"in",
"IFTTT",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ifttt.py#L73-L101 | train | Trigger a configured event in IFTTT. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/napalm.py | init | def init(opts):
'''
Opens the connection with the network device.
'''
NETWORK_DEVICE.update(salt.utils.napalm.get_device(opts))
DETAILS['initialized'] = True
return True | python | def init(opts):
'''
Opens the connection with the network device.
'''
NETWORK_DEVICE.update(salt.utils.napalm.get_device(opts))
DETAILS['initialized'] = True
return True | [
"def",
"init",
"(",
"opts",
")",
":",
"NETWORK_DEVICE",
".",
"update",
"(",
"salt",
".",
"utils",
".",
"napalm",
".",
"get_device",
"(",
"opts",
")",
")",
"DETAILS",
"[",
"'initialized'",
"]",
"=",
"True",
"return",
"True"
] | Opens the connection with the network device. | [
"Opens",
"the",
"connection",
"with",
"the",
"network",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L202-L208 | train | Initialize the network device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/napalm.py | alive | def alive(opts):
'''
Return the connection status with the remote device.
.. versionadded:: 2017.7.0
'''
if salt.utils.napalm.not_always_alive(opts):
return True # don't force reconnection for not-always alive proxies
# or regular minion
is_alive_ret = call('is_alive', **{})
... | python | def alive(opts):
'''
Return the connection status with the remote device.
.. versionadded:: 2017.7.0
'''
if salt.utils.napalm.not_always_alive(opts):
return True # don't force reconnection for not-always alive proxies
# or regular minion
is_alive_ret = call('is_alive', **{})
... | [
"def",
"alive",
"(",
"opts",
")",
":",
"if",
"salt",
".",
"utils",
".",
"napalm",
".",
"not_always_alive",
"(",
"opts",
")",
":",
"return",
"True",
"# don't force reconnection for not-always alive proxies",
"# or regular minion",
"is_alive_ret",
"=",
"call",
"(",
... | Return the connection status with the remote device.
.. versionadded:: 2017.7.0 | [
"Return",
"the",
"connection",
"status",
"with",
"the",
"remote",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L211-L234 | train | Return the connection status with the remote device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/napalm.py | shutdown | def shutdown(opts):
'''
Closes connection with the device.
'''
try:
if not NETWORK_DEVICE.get('UP', False):
raise Exception('not connected!')
NETWORK_DEVICE.get('DRIVER').close()
except Exception as error:
port = NETWORK_DEVICE.get('OPTIONAL_ARGS', {}).get('port')... | python | def shutdown(opts):
'''
Closes connection with the device.
'''
try:
if not NETWORK_DEVICE.get('UP', False):
raise Exception('not connected!')
NETWORK_DEVICE.get('DRIVER').close()
except Exception as error:
port = NETWORK_DEVICE.get('OPTIONAL_ARGS', {}).get('port')... | [
"def",
"shutdown",
"(",
"opts",
")",
":",
"try",
":",
"if",
"not",
"NETWORK_DEVICE",
".",
"get",
"(",
"'UP'",
",",
"False",
")",
":",
"raise",
"Exception",
"(",
"'not connected!'",
")",
"NETWORK_DEVICE",
".",
"get",
"(",
"'DRIVER'",
")",
".",
"close",
... | Closes connection with the device. | [
"Closes",
"connection",
"with",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L282-L299 | train | Closes connection with the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/proxy/napalm.py | call | def call(method, *args, **kwargs):
'''
Calls a specific method from the network driver instance.
Please check the readthedocs_ page for the updated list of getters.
.. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix
:param method: specifies the name ... | python | def call(method, *args, **kwargs):
'''
Calls a specific method from the network driver instance.
Please check the readthedocs_ page for the updated list of getters.
.. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix
:param method: specifies the name ... | [
"def",
"call",
"(",
"method",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_copy",
"=",
"{",
"}",
"kwargs_copy",
".",
"update",
"(",
"kwargs",
")",
"for",
"karg",
",",
"warg",
"in",
"six",
".",
"iteritems",
"(",
"kwargs_copy",
")",
"... | Calls a specific method from the network driver instance.
Please check the readthedocs_ page for the updated list of getters.
.. _readthedocs: http://napalm.readthedocs.org/en/latest/support/index.html#getters-support-matrix
:param method: specifies the name of the method to be called
:param params: c... | [
"Calls",
"a",
"specific",
"method",
"from",
"the",
"network",
"driver",
"instance",
".",
"Please",
"check",
"the",
"readthedocs_",
"page",
"for",
"the",
"updated",
"list",
"of",
"getters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/napalm.py#L306-L346 | train | Calls a specific method from the network driver instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/modules/win_license.py | info | def info():
'''
Return information about the license, if the license is not
correctly activated this will return None.
CLI Example:
.. code-block:: bash
salt '*' license.info
'''
cmd = r'cscript C:\Windows\System32\slmgr.vbs /dli'
out = __salt__['cmd.run'](cmd)
match = re... | python | def info():
'''
Return information about the license, if the license is not
correctly activated this will return None.
CLI Example:
.. code-block:: bash
salt '*' license.info
'''
cmd = r'cscript C:\Windows\System32\slmgr.vbs /dli'
out = __salt__['cmd.run'](cmd)
match = re... | [
"def",
"info",
"(",
")",
":",
"cmd",
"=",
"r'cscript C:\\Windows\\System32\\slmgr.vbs /dli'",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
"match",
"=",
"re",
".",
"search",
"(",
"r'Name: (.*)\\r\\nDescription: (.*)\\r\\nPartial Product Key: (.*)\\r\\... | Return information about the license, if the license is not
correctly activated this will return None.
CLI Example:
.. code-block:: bash
salt '*' license.info | [
"Return",
"information",
"about",
"the",
"license",
"if",
"the",
"license",
"is",
"not",
"correctly",
"activated",
"this",
"will",
"return",
"None",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_license.py#L106-L132 | train | Return information about the license | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | present | def present(name, api_name, swagger_file, stage_name, api_key_required,
lambda_integration_role, lambda_region=None, stage_variables=None,
region=None, key=None, keyid=None, profile=None,
lambda_funcname_format='{stage}_{api}_{resource}_{method}',
authorization_type='NONE... | python | def present(name, api_name, swagger_file, stage_name, api_key_required,
lambda_integration_role, lambda_region=None, stage_variables=None,
region=None, key=None, keyid=None, profile=None,
lambda_funcname_format='{stage}_{api}_{resource}_{method}',
authorization_type='NONE... | [
"def",
"present",
"(",
"name",
",",
"api_name",
",",
"swagger_file",
",",
"stage_name",
",",
"api_key_required",
",",
"lambda_integration_role",
",",
"lambda_region",
"=",
"None",
",",
"stage_variables",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"="... | Ensure the spcified api_name with the corresponding swaggerfile is deployed to the
given stage_name in AWS ApiGateway.
this state currently only supports ApiGateway integration with AWS Lambda, and CORS support is
handled through a Mock integration.
There may be multiple deployments for the API object... | [
"Ensure",
"the",
"spcified",
"api_name",
"with",
"the",
"corresponding",
"swaggerfile",
"is",
"deployed",
"to",
"the",
"given",
"stage_name",
"in",
"AWS",
"ApiGateway",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L79-L339 | train | This function is used to create a new API object in the specified stage. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _get_stage_variables | def _get_stage_variables(stage_variables):
'''
Helper function to retrieve stage variables from pillars/options, if the
input is a string
'''
ret = dict()
if stage_variables is None:
return ret
if isinstance(stage_variables, six.string_types):
if stage_variables in __opts__:... | python | def _get_stage_variables(stage_variables):
'''
Helper function to retrieve stage variables from pillars/options, if the
input is a string
'''
ret = dict()
if stage_variables is None:
return ret
if isinstance(stage_variables, six.string_types):
if stage_variables in __opts__:... | [
"def",
"_get_stage_variables",
"(",
"stage_variables",
")",
":",
"ret",
"=",
"dict",
"(",
")",
"if",
"stage_variables",
"is",
"None",
":",
"return",
"ret",
"if",
"isinstance",
"(",
"stage_variables",
",",
"six",
".",
"string_types",
")",
":",
"if",
"stage_va... | Helper function to retrieve stage variables from pillars/options, if the
input is a string | [
"Helper",
"function",
"to",
"retrieve",
"stage",
"variables",
"from",
"pillars",
"/",
"options",
"if",
"the",
"input",
"is",
"a",
"string"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L342-L365 | train | Helper function to retrieve stage variables from pillars or options | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | absent | def absent(name, api_name, stage_name, nuke_api=False, region=None, key=None, keyid=None, profile=None):
'''
Ensure the stage_name associated with the given api_name deployed by boto_apigateway's
present state is removed. If the currently associated deployment to the given stage_name has
no other stage... | python | def absent(name, api_name, stage_name, nuke_api=False, region=None, key=None, keyid=None, profile=None):
'''
Ensure the stage_name associated with the given api_name deployed by boto_apigateway's
present state is removed. If the currently associated deployment to the given stage_name has
no other stage... | [
"def",
"absent",
"(",
"name",
",",
"api_name",
",",
"stage_name",
",",
"nuke_api",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
... | Ensure the stage_name associated with the given api_name deployed by boto_apigateway's
present state is removed. If the currently associated deployment to the given stage_name has
no other stages associated with it, the deployment will also be removed.
name
Name of the swagger file in YAML format
... | [
"Ensure",
"the",
"stage_name",
"associated",
"with",
"the",
"given",
"api_name",
"deployed",
"by",
"boto_apigateway",
"s",
"present",
"state",
"is",
"removed",
".",
"If",
"the",
"currently",
"associated",
"deployment",
"to",
"the",
"given",
"stage_name",
"has",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L368-L443 | train | Ensure that the given stage_name is absent in the given api. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _gen_md5_filehash | def _gen_md5_filehash(fname, *args):
'''
helper function to generate a md5 hash of the swagger definition file
any extra argument passed to the function is converted to a string
and participates in the hash calculation
'''
_hash = hashlib.md5()
with salt.utils.files.fopen(fname, 'rb') as f:
... | python | def _gen_md5_filehash(fname, *args):
'''
helper function to generate a md5 hash of the swagger definition file
any extra argument passed to the function is converted to a string
and participates in the hash calculation
'''
_hash = hashlib.md5()
with salt.utils.files.fopen(fname, 'rb') as f:
... | [
"def",
"_gen_md5_filehash",
"(",
"fname",
",",
"*",
"args",
")",
":",
"_hash",
"=",
"hashlib",
".",
"md5",
"(",
")",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"fname",
",",
"'rb'",
")",
"as",
"f",
":",
"for",
"chunk",
"in",
"... | helper function to generate a md5 hash of the swagger definition file
any extra argument passed to the function is converted to a string
and participates in the hash calculation | [
"helper",
"function",
"to",
"generate",
"a",
"md5",
"hash",
"of",
"the",
"swagger",
"definition",
"file",
"any",
"extra",
"argument",
"passed",
"to",
"the",
"function",
"is",
"converted",
"to",
"a",
"string",
"and",
"participates",
"in",
"the",
"hash",
"calc... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L447-L460 | train | helper function to generate a md5 hash of the swagger definition file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _dict_to_json_pretty | def _dict_to_json_pretty(d, sort_keys=True):
'''
helper function to generate pretty printed json output
'''
return salt.utils.json.dumps(d, indent=4, separators=(',', ': '), sort_keys=sort_keys) | python | def _dict_to_json_pretty(d, sort_keys=True):
'''
helper function to generate pretty printed json output
'''
return salt.utils.json.dumps(d, indent=4, separators=(',', ': '), sort_keys=sort_keys) | [
"def",
"_dict_to_json_pretty",
"(",
"d",
",",
"sort_keys",
"=",
"True",
")",
":",
"return",
"salt",
".",
"utils",
".",
"json",
".",
"dumps",
"(",
"d",
",",
"indent",
"=",
"4",
",",
"separators",
"=",
"(",
"','",
",",
"': '",
")",
",",
"sort_keys",
... | helper function to generate pretty printed json output | [
"helper",
"function",
"to",
"generate",
"pretty",
"printed",
"json",
"output"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L463-L467 | train | helper function to generate pretty printed json output
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _name_matches | def _name_matches(name, matches):
'''
Helper function to see if given name has any of the patterns in given matches
'''
for m in matches:
if name.endswith(m):
return True
if name.lower().endswith('_' + m.lower()):
return True
if name.lower() == m.lower():
... | python | def _name_matches(name, matches):
'''
Helper function to see if given name has any of the patterns in given matches
'''
for m in matches:
if name.endswith(m):
return True
if name.lower().endswith('_' + m.lower()):
return True
if name.lower() == m.lower():
... | [
"def",
"_name_matches",
"(",
"name",
",",
"matches",
")",
":",
"for",
"m",
"in",
"matches",
":",
"if",
"name",
".",
"endswith",
"(",
"m",
")",
":",
"return",
"True",
"if",
"name",
".",
"lower",
"(",
")",
".",
"endswith",
"(",
"'_'",
"+",
"m",
"."... | Helper function to see if given name has any of the patterns in given matches | [
"Helper",
"function",
"to",
"see",
"if",
"given",
"name",
"has",
"any",
"of",
"the",
"patterns",
"in",
"given",
"matches"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L472-L483 | train | Helper function to see if given name matches a list of patterns in given matches | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _object_reducer | def _object_reducer(o, names=('id', 'name', 'path', 'httpMethod',
'statusCode', 'Created', 'Deleted',
'Updated', 'Flushed', 'Associated', 'Disassociated')):
'''
Helper function to reduce the amount of information that will be kept in the change log
... | python | def _object_reducer(o, names=('id', 'name', 'path', 'httpMethod',
'statusCode', 'Created', 'Deleted',
'Updated', 'Flushed', 'Associated', 'Disassociated')):
'''
Helper function to reduce the amount of information that will be kept in the change log
... | [
"def",
"_object_reducer",
"(",
"o",
",",
"names",
"=",
"(",
"'id'",
",",
"'name'",
",",
"'path'",
",",
"'httpMethod'",
",",
"'statusCode'",
",",
"'Created'",
",",
"'Deleted'",
",",
"'Updated'",
",",
"'Flushed'",
",",
"'Associated'",
",",
"'Disassociated'",
"... | Helper function to reduce the amount of information that will be kept in the change log
for API GW related return values | [
"Helper",
"function",
"to",
"reduce",
"the",
"amount",
"of",
"information",
"that",
"will",
"be",
"kept",
"in",
"the",
"change",
"log",
"for",
"API",
"GW",
"related",
"return",
"values"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L486-L511 | train | Helper function to reduce the amount of information that will be kept in the change log for API GW related return values
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _log_changes | def _log_changes(ret, changekey, changevalue):
'''
For logging create/update/delete operations to AWS ApiGateway
'''
cl = ret['changes'].get('new', [])
cl.append({changekey: _object_reducer(changevalue)})
ret['changes']['new'] = cl
return ret | python | def _log_changes(ret, changekey, changevalue):
'''
For logging create/update/delete operations to AWS ApiGateway
'''
cl = ret['changes'].get('new', [])
cl.append({changekey: _object_reducer(changevalue)})
ret['changes']['new'] = cl
return ret | [
"def",
"_log_changes",
"(",
"ret",
",",
"changekey",
",",
"changevalue",
")",
":",
"cl",
"=",
"ret",
"[",
"'changes'",
"]",
".",
"get",
"(",
"'new'",
",",
"[",
"]",
")",
"cl",
".",
"append",
"(",
"{",
"changekey",
":",
"_object_reducer",
"(",
"change... | For logging create/update/delete operations to AWS ApiGateway | [
"For",
"logging",
"create",
"/",
"update",
"/",
"delete",
"operations",
"to",
"AWS",
"ApiGateway"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L514-L521 | train | Log the changes to AWS ApiGateway | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _log_error_and_abort | def _log_error_and_abort(ret, obj):
'''
helper function to update errors in the return structure
'''
ret['result'] = False
ret['abort'] = True
if 'error' in obj:
ret['comment'] = '{0}'.format(obj.get('error'))
return ret | python | def _log_error_and_abort(ret, obj):
'''
helper function to update errors in the return structure
'''
ret['result'] = False
ret['abort'] = True
if 'error' in obj:
ret['comment'] = '{0}'.format(obj.get('error'))
return ret | [
"def",
"_log_error_and_abort",
"(",
"ret",
",",
"obj",
")",
":",
"ret",
"[",
"'result'",
"]",
"=",
"False",
"ret",
"[",
"'abort'",
"]",
"=",
"True",
"if",
"'error'",
"in",
"obj",
":",
"ret",
"[",
"'comment'",
"]",
"=",
"'{0}'",
".",
"format",
"(",
... | helper function to update errors in the return structure | [
"helper",
"function",
"to",
"update",
"errors",
"in",
"the",
"return",
"structure"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L524-L532 | train | helper function to update errors in the return structure and abort | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | usage_plan_present | def usage_plan_present(name, plan_name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None,
profile=None):
'''
Ensure the spcifieda usage plan with the corresponding metrics is deployed
.. versionadded:: 2017.7.0
name
name of the state
pl... | python | def usage_plan_present(name, plan_name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None,
profile=None):
'''
Ensure the spcifieda usage plan with the corresponding metrics is deployed
.. versionadded:: 2017.7.0
name
name of the state
pl... | [
"def",
"usage_plan_present",
"(",
"name",
",",
"plan_name",
",",
"description",
"=",
"None",
",",
"throttle",
"=",
"None",
",",
"quota",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
... | Ensure the spcifieda usage plan with the corresponding metrics is deployed
.. versionadded:: 2017.7.0
name
name of the state
plan_name
[Required] name of the usage plan
throttle
[Optional] throttling parameters expressed as a dictionary.
If provided, at least one of t... | [
"Ensure",
"the",
"spcifieda",
"usage",
"plan",
"with",
"the",
"corresponding",
"metrics",
"is",
"deployed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1688-L1826 | train | Ensure that the usage plan with the corresponding metrics is deployed | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | usage_plan_absent | def usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profile=None):
'''
Ensures usage plan identified by name is no longer present
.. versionadded:: 2017.7.0
name
name of the state
plan_name
name of the plan to remove
.. code-block:: yaml
usage p... | python | def usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profile=None):
'''
Ensures usage plan identified by name is no longer present
.. versionadded:: 2017.7.0
name
name of the state
plan_name
name of the plan to remove
.. code-block:: yaml
usage p... | [
"def",
"usage_plan_absent",
"(",
"name",
",",
"plan_name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"True",
... | Ensures usage plan identified by name is no longer present
.. versionadded:: 2017.7.0
name
name of the state
plan_name
name of the plan to remove
.. code-block:: yaml
usage plan absent:
boto_apigateway.usage_plan_absent:
- plan_name: my_usage_plan
... | [
"Ensures",
"usage",
"plan",
"identified",
"by",
"name",
"is",
"no",
"longer",
"present"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1829-L1892 | train | Ensures that the usage plan identified by name is absent. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | usage_plan_association_present | def usage_plan_association_present(name, plan_name, api_stages, region=None, key=None, keyid=None, profile=None):
'''
Ensures usage plan identified by name is added to provided api_stages
.. versionadded:: 2017.7.0
name
name of the state
plan_name
name of the plan to use
api_... | python | def usage_plan_association_present(name, plan_name, api_stages, region=None, key=None, keyid=None, profile=None):
'''
Ensures usage plan identified by name is added to provided api_stages
.. versionadded:: 2017.7.0
name
name of the state
plan_name
name of the plan to use
api_... | [
"def",
"usage_plan_association_present",
"(",
"name",
",",
"plan_name",
",",
"api_stages",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",... | Ensures usage plan identified by name is added to provided api_stages
.. versionadded:: 2017.7.0
name
name of the state
plan_name
name of the plan to use
api_stages
list of dictionaries, where each dictionary consists of the following keys:
apiId
apiId of... | [
"Ensures",
"usage",
"plan",
"identified",
"by",
"name",
"is",
"added",
"to",
"provided",
"api_stages"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1895-L1985 | train | Ensures usage plan with given name is added to provided list of api_stages | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._validate_error_response_model | def _validate_error_response_model(self, paths, mods):
'''
Helper function to help validate the convention established in the swagger file on how
to handle response code mapping/integration
'''
for path, ops in paths:
for opname, opobj in six.iteritems(ops):
... | python | def _validate_error_response_model(self, paths, mods):
'''
Helper function to help validate the convention established in the swagger file on how
to handle response code mapping/integration
'''
for path, ops in paths:
for opname, opobj in six.iteritems(ops):
... | [
"def",
"_validate_error_response_model",
"(",
"self",
",",
"paths",
",",
"mods",
")",
":",
"for",
"path",
",",
"ops",
"in",
"paths",
":",
"for",
"opname",
",",
"opobj",
"in",
"six",
".",
"iteritems",
"(",
"ops",
")",
":",
"if",
"opname",
"not",
"in",
... | Helper function to help validate the convention established in the swagger file on how
to handle response code mapping/integration | [
"Helper",
"function",
"to",
"help",
"validate",
"the",
"convention",
"established",
"in",
"the",
"swagger",
"file",
"on",
"how",
"to",
"handle",
"response",
"code",
"mapping",
"/",
"integration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L754-L796 | train | Helper function to help validate the error response model for a given path. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._validate_lambda_funcname_format | def _validate_lambda_funcname_format(self):
'''
Checks if the lambda function name format contains only known elements
:return: True on success, ValueError raised on error
'''
try:
if self._lambda_funcname_format:
known_kwargs = dict(stage='',
... | python | def _validate_lambda_funcname_format(self):
'''
Checks if the lambda function name format contains only known elements
:return: True on success, ValueError raised on error
'''
try:
if self._lambda_funcname_format:
known_kwargs = dict(stage='',
... | [
"def",
"_validate_lambda_funcname_format",
"(",
"self",
")",
":",
"try",
":",
"if",
"self",
".",
"_lambda_funcname_format",
":",
"known_kwargs",
"=",
"dict",
"(",
"stage",
"=",
"''",
",",
"api",
"=",
"''",
",",
"resource",
"=",
"''",
",",
"method",
"=",
... | Checks if the lambda function name format contains only known elements
:return: True on success, ValueError raised on error | [
"Checks",
"if",
"the",
"lambda",
"function",
"name",
"format",
"contains",
"only",
"known",
"elements",
":",
"return",
":",
"True",
"on",
"success",
"ValueError",
"raised",
"on",
"error"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L798-L813 | train | Checks if the lambda function name format contains only known elements
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._validate_swagger_file | def _validate_swagger_file(self):
'''
High level check/validation of the input swagger file based on
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
This is not a full schema compliance check, but rather make sure that the input file (YAML or
JSON) can be... | python | def _validate_swagger_file(self):
'''
High level check/validation of the input swagger file based on
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
This is not a full schema compliance check, but rather make sure that the input file (YAML or
JSON) can be... | [
"def",
"_validate_swagger_file",
"(",
"self",
")",
":",
"# check for any invalid fields for Swagger Object V2",
"for",
"field",
"in",
"self",
".",
"_cfg",
":",
"if",
"(",
"field",
"not",
"in",
"_Swagger",
".",
"SWAGGER_OBJ_V2_FIELDS",
"and",
"not",
"_Swagger",
".",
... | High level check/validation of the input swagger file based on
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
This is not a full schema compliance check, but rather make sure that the input file (YAML or
JSON) can be read into a dictionary, and we check for the content ... | [
"High",
"level",
"check",
"/",
"validation",
"of",
"the",
"input",
"swagger",
"file",
"based",
"on",
"https",
":",
"//",
"github",
".",
"com",
"/",
"swagger",
"-",
"api",
"/",
"swagger",
"-",
"spec",
"/",
"blob",
"/",
"master",
"/",
"versions",
"/",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L815-L844 | train | Validate the input swagger file for the current version of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.models | def models(self):
'''
generator to return the tuple of model and its schema to create on aws.
'''
model_dict = self._build_all_dependencies()
while True:
model = self._get_model_without_dependencies(model_dict)
if not model:
break
... | python | def models(self):
'''
generator to return the tuple of model and its schema to create on aws.
'''
model_dict = self._build_all_dependencies()
while True:
model = self._get_model_without_dependencies(model_dict)
if not model:
break
... | [
"def",
"models",
"(",
"self",
")",
":",
"model_dict",
"=",
"self",
".",
"_build_all_dependencies",
"(",
")",
"while",
"True",
":",
"model",
"=",
"self",
".",
"_get_model_without_dependencies",
"(",
"model_dict",
")",
"if",
"not",
"model",
":",
"break",
"yiel... | generator to return the tuple of model and its schema to create on aws. | [
"generator",
"to",
"return",
"the",
"tuple",
"of",
"model",
"and",
"its",
"schema",
"to",
"create",
"on",
"aws",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L898-L907 | train | generator to return the tuple of model and schema to create on aws. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.paths | def paths(self):
'''
returns an iterator for the relative resource paths specified in the swagger file
'''
paths = self._cfg.get('paths')
if not paths:
raise ValueError('Paths Object has no values, You need to define them in your swagger file')
for path in pat... | python | def paths(self):
'''
returns an iterator for the relative resource paths specified in the swagger file
'''
paths = self._cfg.get('paths')
if not paths:
raise ValueError('Paths Object has no values, You need to define them in your swagger file')
for path in pat... | [
"def",
"paths",
"(",
"self",
")",
":",
"paths",
"=",
"self",
".",
"_cfg",
".",
"get",
"(",
"'paths'",
")",
"if",
"not",
"paths",
":",
"raise",
"ValueError",
"(",
"'Paths Object has no values, You need to define them in your swagger file'",
")",
"for",
"path",
"i... | returns an iterator for the relative resource paths specified in the swagger file | [
"returns",
"an",
"iterator",
"for",
"the",
"relative",
"resource",
"paths",
"specified",
"in",
"the",
"swagger",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L910-L920 | train | returns an iterator for the relative resource paths specified in the swagger file
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.deployment_label | def deployment_label(self):
'''
this property returns the deployment label dictionary (mainly used by
stage description)
'''
label = dict()
label['swagger_info_object'] = self.info
label['api_name'] = self.rest_api_name
label['swagger_file'] = os.path.bas... | python | def deployment_label(self):
'''
this property returns the deployment label dictionary (mainly used by
stage description)
'''
label = dict()
label['swagger_info_object'] = self.info
label['api_name'] = self.rest_api_name
label['swagger_file'] = os.path.bas... | [
"def",
"deployment_label",
"(",
"self",
")",
":",
"label",
"=",
"dict",
"(",
")",
"label",
"[",
"'swagger_info_object'",
"]",
"=",
"self",
".",
"info",
"label",
"[",
"'api_name'",
"]",
"=",
"self",
".",
"rest_api_name",
"label",
"[",
"'swagger_file'",
"]",... | this property returns the deployment label dictionary (mainly used by
stage description) | [
"this",
"property",
"returns",
"the",
"deployment",
"label",
"dictionary",
"(",
"mainly",
"used",
"by",
"stage",
"description",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L953-L965 | train | this property returns the deployment label dictionary | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._one_or_more_stages_remain | def _one_or_more_stages_remain(self, deploymentId):
'''
Helper function to find whether there are other stages still associated with a deployment
'''
stages = __salt__['boto_apigateway.describe_api_stages'](restApiId=self.restApiId,
... | python | def _one_or_more_stages_remain(self, deploymentId):
'''
Helper function to find whether there are other stages still associated with a deployment
'''
stages = __salt__['boto_apigateway.describe_api_stages'](restApiId=self.restApiId,
... | [
"def",
"_one_or_more_stages_remain",
"(",
"self",
",",
"deploymentId",
")",
":",
"stages",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_stages'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"deploymentId",
"=",
"deploymentId",
",",
"*",
"*",... | Helper function to find whether there are other stages still associated with a deployment | [
"Helper",
"function",
"to",
"find",
"whether",
"there",
"are",
"other",
"stages",
"still",
"associated",
"with",
"a",
"deployment"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L968-L975 | train | Helper function to find whether there are other stages still associated with a deploymentId | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.no_more_deployments_remain | def no_more_deployments_remain(self):
'''
Helper function to find whether there are deployments left with stages associated
'''
no_more_deployments = True
deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restApiId,
... | python | def no_more_deployments_remain(self):
'''
Helper function to find whether there are deployments left with stages associated
'''
no_more_deployments = True
deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restApiId,
... | [
"def",
"no_more_deployments_remain",
"(",
"self",
")",
":",
"no_more_deployments",
"=",
"True",
"deployments",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_deployments'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"*",
"*",
"self",
".",
"_c... | Helper function to find whether there are deployments left with stages associated | [
"Helper",
"function",
"to",
"find",
"whether",
"there",
"are",
"deployments",
"left",
"with",
"stages",
"associated"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L977-L994 | train | Helper function to find whether there are deployments left with stages associated
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._get_current_deployment_id | def _get_current_deployment_id(self):
'''
Helper method to find the deployment id that the stage name is currently assocaited with.
'''
deploymentId = ''
stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId,
... | python | def _get_current_deployment_id(self):
'''
Helper method to find the deployment id that the stage name is currently assocaited with.
'''
deploymentId = ''
stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId,
... | [
"def",
"_get_current_deployment_id",
"(",
"self",
")",
":",
"deploymentId",
"=",
"''",
"stage",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_stage'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"stageName",
"=",
"self",
".",
"_stage_name",
... | Helper method to find the deployment id that the stage name is currently assocaited with. | [
"Helper",
"method",
"to",
"find",
"the",
"deployment",
"id",
"that",
"the",
"stage",
"name",
"is",
"currently",
"assocaited",
"with",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L996-L1006 | train | Helper method to find the deployment id that the stage name is currently assocaited with. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._get_current_deployment_label | def _get_current_deployment_label(self):
'''
Helper method to find the deployment label that the stage_name is currently associated with.
'''
deploymentId = self._get_current_deployment_id()
deployment = __salt__['boto_apigateway.describe_api_deployment'](restApiId=self.restApiId... | python | def _get_current_deployment_label(self):
'''
Helper method to find the deployment label that the stage_name is currently associated with.
'''
deploymentId = self._get_current_deployment_id()
deployment = __salt__['boto_apigateway.describe_api_deployment'](restApiId=self.restApiId... | [
"def",
"_get_current_deployment_label",
"(",
"self",
")",
":",
"deploymentId",
"=",
"self",
".",
"_get_current_deployment_id",
"(",
")",
"deployment",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_deployment'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiI... | Helper method to find the deployment label that the stage_name is currently associated with. | [
"Helper",
"method",
"to",
"find",
"the",
"deployment",
"label",
"that",
"the",
"stage_name",
"is",
"currently",
"associated",
"with",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1008-L1018 | train | Helper method to find the deployment label that the stage_name is currently associated with. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._get_desired_deployment_id | def _get_desired_deployment_id(self):
'''
Helper method to return the deployment id matching the desired deployment label for
this Swagger object based on the given api_name, swagger_file
'''
deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restAp... | python | def _get_desired_deployment_id(self):
'''
Helper method to return the deployment id matching the desired deployment label for
this Swagger object based on the given api_name, swagger_file
'''
deployments = __salt__['boto_apigateway.describe_api_deployments'](restApiId=self.restAp... | [
"def",
"_get_desired_deployment_id",
"(",
"self",
")",
":",
"deployments",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_deployments'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"*",
"*",
"self",
".",
"_common_aws_args",
")",
".",
"get",
... | Helper method to return the deployment id matching the desired deployment label for
this Swagger object based on the given api_name, swagger_file | [
"Helper",
"method",
"to",
"return",
"the",
"deployment",
"id",
"matching",
"the",
"desired",
"deployment",
"label",
"for",
"this",
"Swagger",
"object",
"based",
"on",
"the",
"given",
"api_name",
"swagger_file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1020-L1031 | train | Helper method to return the deployment id matching the desired deployment label for this Swagger object based on the given api_name swagger_file
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.overwrite_stage_variables | def overwrite_stage_variables(self, ret, stage_variables):
'''
overwrite the given stage_name's stage variables with the given stage_variables
'''
res = __salt__['boto_apigateway.overwrite_api_stage_variables'](restApiId=self.restApiId,
... | python | def overwrite_stage_variables(self, ret, stage_variables):
'''
overwrite the given stage_name's stage variables with the given stage_variables
'''
res = __salt__['boto_apigateway.overwrite_api_stage_variables'](restApiId=self.restApiId,
... | [
"def",
"overwrite_stage_variables",
"(",
"self",
",",
"ret",
",",
"stage_variables",
")",
":",
"res",
"=",
"__salt__",
"[",
"'boto_apigateway.overwrite_api_stage_variables'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"stageName",
"=",
"self",
".",... | overwrite the given stage_name's stage variables with the given stage_variables | [
"overwrite",
"the",
"given",
"stage_name",
"s",
"stage",
"variables",
"with",
"the",
"given",
"stage_variables"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1033-L1050 | train | overwrite the given stage_name s stage variables with the given stage_variables
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._set_current_deployment | def _set_current_deployment(self, stage_desc_json, stage_variables):
'''
Helper method to associate the stage_name to the given deploymentId and make this current
'''
stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId,
... | python | def _set_current_deployment(self, stage_desc_json, stage_variables):
'''
Helper method to associate the stage_name to the given deploymentId and make this current
'''
stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId,
... | [
"def",
"_set_current_deployment",
"(",
"self",
",",
"stage_desc_json",
",",
"stage_variables",
")",
":",
"stage",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_stage'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"stageName",
"=",
"self",
"."... | Helper method to associate the stage_name to the given deploymentId and make this current | [
"Helper",
"method",
"to",
"associate",
"the",
"stage_name",
"to",
"the",
"given",
"deploymentId",
"and",
"make",
"this",
"current"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1052-L1080 | train | Helper method to associate the stage_name to the given deploymentId and make this current
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._resolve_api_id | def _resolve_api_id(self):
'''
returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION
as the api description
'''
apis = __salt__['boto_apigateway.describe_apis'](name=self.rest_api_name,
... | python | def _resolve_api_id(self):
'''
returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION
as the api description
'''
apis = __salt__['boto_apigateway.describe_apis'](name=self.rest_api_name,
... | [
"def",
"_resolve_api_id",
"(",
"self",
")",
":",
"apis",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_apis'",
"]",
"(",
"name",
"=",
"self",
".",
"rest_api_name",
",",
"description",
"=",
"_Swagger",
".",
"AWS_API_DESCRIPTION",
",",
"*",
"*",
"self",
".",
... | returns an Api Id that matches the given api_name and the hardcoded _Swagger.AWS_API_DESCRIPTION
as the api description | [
"returns",
"an",
"Api",
"Id",
"that",
"matches",
"the",
"given",
"api_name",
"and",
"the",
"hardcoded",
"_Swagger",
".",
"AWS_API_DESCRIPTION",
"as",
"the",
"api",
"description"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1082-L1095 | train | Resolves the Api Id that matches the given name and the hardcoded _Swagger. AWS_API_DESCRIPTION as the api description
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.publish_api | def publish_api(self, ret, stage_variables):
'''
this method tie the given stage_name to a deployment matching the given swagger_file
'''
stage_desc = dict()
stage_desc['current_deployment_label'] = self.deployment_label
stage_desc_json = _dict_to_json_pretty(stage_desc)
... | python | def publish_api(self, ret, stage_variables):
'''
this method tie the given stage_name to a deployment matching the given swagger_file
'''
stage_desc = dict()
stage_desc['current_deployment_label'] = self.deployment_label
stage_desc_json = _dict_to_json_pretty(stage_desc)
... | [
"def",
"publish_api",
"(",
"self",
",",
"ret",
",",
"stage_variables",
")",
":",
"stage_desc",
"=",
"dict",
"(",
")",
"stage_desc",
"[",
"'current_deployment_label'",
"]",
"=",
"self",
".",
"deployment_label",
"stage_desc_json",
"=",
"_dict_to_json_pretty",
"(",
... | this method tie the given stage_name to a deployment matching the given swagger_file | [
"this",
"method",
"tie",
"the",
"given",
"stage_name",
"to",
"a",
"deployment",
"matching",
"the",
"given",
"swagger_file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1154-L1187 | train | This method tie the given stage_name to a deployment matching the given swagger_file
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._cleanup_api | def _cleanup_api(self):
'''
Helper method to clean up resources and models if we detected a change in the swagger file
for a stage
'''
resources = __salt__['boto_apigateway.describe_api_resources'](restApiId=self.restApiId,
... | python | def _cleanup_api(self):
'''
Helper method to clean up resources and models if we detected a change in the swagger file
for a stage
'''
resources = __salt__['boto_apigateway.describe_api_resources'](restApiId=self.restApiId,
... | [
"def",
"_cleanup_api",
"(",
"self",
")",
":",
"resources",
"=",
"__salt__",
"[",
"'boto_apigateway.describe_api_resources'",
"]",
"(",
"restApiId",
"=",
"self",
".",
"restApiId",
",",
"*",
"*",
"self",
".",
"_common_aws_args",
")",
"if",
"resources",
".",
"get... | Helper method to clean up resources and models if we detected a change in the swagger file
for a stage | [
"Helper",
"method",
"to",
"clean",
"up",
"resources",
"and",
"models",
"if",
"we",
"detected",
"a",
"change",
"in",
"the",
"swagger",
"file",
"for",
"a",
"stage"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1189-L1215 | train | Helper method to clean up resources and models for a stage | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.deploy_api | def deploy_api(self, ret):
'''
this method create the top level rest api in AWS apigateway
'''
if self.restApiId:
res = self._cleanup_api()
if not res.get('deleted'):
ret['comment'] = 'Failed to cleanup restAreId {0}'.format(self.restApiId)
... | python | def deploy_api(self, ret):
'''
this method create the top level rest api in AWS apigateway
'''
if self.restApiId:
res = self._cleanup_api()
if not res.get('deleted'):
ret['comment'] = 'Failed to cleanup restAreId {0}'.format(self.restApiId)
... | [
"def",
"deploy_api",
"(",
"self",
",",
"ret",
")",
":",
"if",
"self",
".",
"restApiId",
":",
"res",
"=",
"self",
".",
"_cleanup_api",
"(",
")",
"if",
"not",
"res",
".",
"get",
"(",
"'deleted'",
")",
":",
"ret",
"[",
"'comment'",
"]",
"=",
"'Failed ... | this method create the top level rest api in AWS apigateway | [
"this",
"method",
"create",
"the",
"top",
"level",
"rest",
"api",
"in",
"AWS",
"apigateway"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1217-L1243 | train | This method create the top level rest api in AWS apigateway | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.delete_api | def delete_api(self, ret):
'''
Method to delete a Rest Api named defined in the swagger file's Info Object's title value.
ret
a dictionary for returning status to Saltstack
'''
exists_response = __salt__['boto_apigateway.api_exists'](name=self.rest_api_name,
... | python | def delete_api(self, ret):
'''
Method to delete a Rest Api named defined in the swagger file's Info Object's title value.
ret
a dictionary for returning status to Saltstack
'''
exists_response = __salt__['boto_apigateway.api_exists'](name=self.rest_api_name,
... | [
"def",
"delete_api",
"(",
"self",
",",
"ret",
")",
":",
"exists_response",
"=",
"__salt__",
"[",
"'boto_apigateway.api_exists'",
"]",
"(",
"name",
"=",
"self",
".",
"rest_api_name",
",",
"description",
"=",
"_Swagger",
".",
"AWS_API_DESCRIPTION",
",",
"*",
"*"... | Method to delete a Rest Api named defined in the swagger file's Info Object's title value.
ret
a dictionary for returning status to Saltstack | [
"Method",
"to",
"delete",
"a",
"Rest",
"Api",
"named",
"defined",
"in",
"the",
"swagger",
"file",
"s",
"Info",
"Object",
"s",
"title",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1245-L1278 | train | Method to delete a Rest Api from the Swagger file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._aws_model_ref_from_swagger_ref | def _aws_model_ref_from_swagger_ref(self, r):
'''
Helper function to reference models created on aws apigw
'''
model_name = r.split('/')[-1]
return 'https://apigateway.amazonaws.com/restapis/{0}/models/{1}'.format(self.restApiId, model_name) | python | def _aws_model_ref_from_swagger_ref(self, r):
'''
Helper function to reference models created on aws apigw
'''
model_name = r.split('/')[-1]
return 'https://apigateway.amazonaws.com/restapis/{0}/models/{1}'.format(self.restApiId, model_name) | [
"def",
"_aws_model_ref_from_swagger_ref",
"(",
"self",
",",
"r",
")",
":",
"model_name",
"=",
"r",
".",
"split",
"(",
"'/'",
")",
"[",
"-",
"1",
"]",
"return",
"'https://apigateway.amazonaws.com/restapis/{0}/models/{1}'",
".",
"format",
"(",
"self",
".",
"restAp... | Helper function to reference models created on aws apigw | [
"Helper",
"function",
"to",
"reference",
"models",
"created",
"on",
"aws",
"apigw"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1280-L1285 | train | Helper function to reference models created on aws apigw
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._update_schema_to_aws_notation | def _update_schema_to_aws_notation(self, schema):
'''
Helper function to map model schema to aws notation
'''
result = {}
for k, v in schema.items():
if k == '$ref':
v = self._aws_model_ref_from_swagger_ref(v)
if isinstance(v, dict):
... | python | def _update_schema_to_aws_notation(self, schema):
'''
Helper function to map model schema to aws notation
'''
result = {}
for k, v in schema.items():
if k == '$ref':
v = self._aws_model_ref_from_swagger_ref(v)
if isinstance(v, dict):
... | [
"def",
"_update_schema_to_aws_notation",
"(",
"self",
",",
"schema",
")",
":",
"result",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"schema",
".",
"items",
"(",
")",
":",
"if",
"k",
"==",
"'$ref'",
":",
"v",
"=",
"self",
".",
"_aws_model_ref_from_swagg... | Helper function to map model schema to aws notation | [
"Helper",
"function",
"to",
"map",
"model",
"schema",
"to",
"aws",
"notation"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1287-L1298 | train | Helper function to map model schema to aws notation | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._build_dependent_model_list | def _build_dependent_model_list(self, obj_schema):
'''
Helper function to build the list of models the given object schema is referencing.
'''
dep_models_list = []
if obj_schema:
obj_schema['type'] = obj_schema.get('type', 'object')
if obj_schema['type'] == '... | python | def _build_dependent_model_list(self, obj_schema):
'''
Helper function to build the list of models the given object schema is referencing.
'''
dep_models_list = []
if obj_schema:
obj_schema['type'] = obj_schema.get('type', 'object')
if obj_schema['type'] == '... | [
"def",
"_build_dependent_model_list",
"(",
"self",
",",
"obj_schema",
")",
":",
"dep_models_list",
"=",
"[",
"]",
"if",
"obj_schema",
":",
"obj_schema",
"[",
"'type'",
"]",
"=",
"obj_schema",
".",
"get",
"(",
"'type'",
",",
"'object'",
")",
"if",
"obj_schema... | Helper function to build the list of models the given object schema is referencing. | [
"Helper",
"function",
"to",
"build",
"the",
"list",
"of",
"models",
"the",
"given",
"object",
"schema",
"is",
"referencing",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1300-L1323 | train | Helper function to build the list of models that the given object schema is referencing. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._build_all_dependencies | def _build_all_dependencies(self):
'''
Helper function to build a map of model to their list of model reference dependencies
'''
ret = {}
for model, schema in six.iteritems(self._models()):
dep_list = self._build_dependent_model_list(schema)
ret[model] = d... | python | def _build_all_dependencies(self):
'''
Helper function to build a map of model to their list of model reference dependencies
'''
ret = {}
for model, schema in six.iteritems(self._models()):
dep_list = self._build_dependent_model_list(schema)
ret[model] = d... | [
"def",
"_build_all_dependencies",
"(",
"self",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"model",
",",
"schema",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"_models",
"(",
")",
")",
":",
"dep_list",
"=",
"self",
".",
"_build_dependent_model_list",
"("... | Helper function to build a map of model to their list of model reference dependencies | [
"Helper",
"function",
"to",
"build",
"a",
"map",
"of",
"model",
"to",
"their",
"list",
"of",
"model",
"reference",
"dependencies"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1325-L1333 | train | Helper function to build a map of model to their list of model reference dependencies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._get_model_without_dependencies | def _get_model_without_dependencies(self, models_dict):
'''
Helper function to find the next model that should be created
'''
next_model = None
if not models_dict:
return next_model
for model, dependencies in six.iteritems(models_dict):
if depende... | python | def _get_model_without_dependencies(self, models_dict):
'''
Helper function to find the next model that should be created
'''
next_model = None
if not models_dict:
return next_model
for model, dependencies in six.iteritems(models_dict):
if depende... | [
"def",
"_get_model_without_dependencies",
"(",
"self",
",",
"models_dict",
")",
":",
"next_model",
"=",
"None",
"if",
"not",
"models_dict",
":",
"return",
"next_model",
"for",
"model",
",",
"dependencies",
"in",
"six",
".",
"iteritems",
"(",
"models_dict",
")",
... | Helper function to find the next model that should be created | [
"Helper",
"function",
"to",
"find",
"the",
"next",
"model",
"that",
"should",
"be",
"created"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1335-L1358 | train | Helper function to find the next model that should be created
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.deploy_models | def deploy_models(self, ret):
'''
Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models
ret
a dictionary for returning status to Saltstack
'''
for model, schema in self.models():
# add in a few attributes in... | python | def deploy_models(self, ret):
'''
Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models
ret
a dictionary for returning status to Saltstack
'''
for model, schema in self.models():
# add in a few attributes in... | [
"def",
"deploy_models",
"(",
"self",
",",
"ret",
")",
":",
"for",
"model",
",",
"schema",
"in",
"self",
".",
"models",
"(",
")",
":",
"# add in a few attributes into the model schema that AWS expects",
"# _schema = schema.copy()",
"_schema",
"=",
"self",
".",
"_upda... | Method to deploy swagger file's definition objects and associated schema to AWS Apigateway as Models
ret
a dictionary for returning status to Saltstack | [
"Method",
"to",
"deploy",
"swagger",
"file",
"s",
"definition",
"objects",
"and",
"associated",
"schema",
"to",
"AWS",
"Apigateway",
"as",
"Models"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1360-L1416 | train | Method to deploy models to AWS Apigateway as Models
SetException | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._lambda_name | def _lambda_name(self, resourcePath, httpMethod):
'''
Helper method to construct lambda name based on the rule specified in doc string of
boto_apigateway.api_present function
'''
lambda_name = self._lambda_funcname_format.format(stage=self._stage_name,
... | python | def _lambda_name(self, resourcePath, httpMethod):
'''
Helper method to construct lambda name based on the rule specified in doc string of
boto_apigateway.api_present function
'''
lambda_name = self._lambda_funcname_format.format(stage=self._stage_name,
... | [
"def",
"_lambda_name",
"(",
"self",
",",
"resourcePath",
",",
"httpMethod",
")",
":",
"lambda_name",
"=",
"self",
".",
"_lambda_funcname_format",
".",
"format",
"(",
"stage",
"=",
"self",
".",
"_stage_name",
",",
"api",
"=",
"self",
".",
"rest_api_name",
","... | Helper method to construct lambda name based on the rule specified in doc string of
boto_apigateway.api_present function | [
"Helper",
"method",
"to",
"construct",
"lambda",
"name",
"based",
"on",
"the",
"rule",
"specified",
"in",
"doc",
"string",
"of",
"boto_apigateway",
".",
"api_present",
"function"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1418-L1430 | train | Helper method to construct lambda name based on the rule specified in doc string of
boto_apigateway. api_present function
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._lambda_uri | def _lambda_uri(self, lambda_name, lambda_region):
'''
Helper Method to construct the lambda uri for use in method integration
'''
profile = self._common_aws_args.get('profile')
region = self._common_aws_args.get('region')
lambda_region = __utils__['boto3.get_region']('l... | python | def _lambda_uri(self, lambda_name, lambda_region):
'''
Helper Method to construct the lambda uri for use in method integration
'''
profile = self._common_aws_args.get('profile')
region = self._common_aws_args.get('region')
lambda_region = __utils__['boto3.get_region']('l... | [
"def",
"_lambda_uri",
"(",
"self",
",",
"lambda_name",
",",
"lambda_region",
")",
":",
"profile",
"=",
"self",
".",
"_common_aws_args",
".",
"get",
"(",
"'profile'",
")",
"region",
"=",
"self",
".",
"_common_aws_args",
".",
"get",
"(",
"'region'",
")",
"la... | Helper Method to construct the lambda uri for use in method integration | [
"Helper",
"Method",
"to",
"construct",
"the",
"lambda",
"uri",
"for",
"use",
"in",
"method",
"integration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1432-L1456 | train | Helper Method to construct the lambda uri for use in method integration | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._parse_method_data | def _parse_method_data(self, method_name, method_data):
'''
Helper function to construct the method request params, models, request_templates and
integration_type values needed to configure method request integration/mappings.
'''
method_params = {}
method_models = {}
... | python | def _parse_method_data(self, method_name, method_data):
'''
Helper function to construct the method request params, models, request_templates and
integration_type values needed to configure method request integration/mappings.
'''
method_params = {}
method_models = {}
... | [
"def",
"_parse_method_data",
"(",
"self",
",",
"method_name",
",",
"method_data",
")",
":",
"method_params",
"=",
"{",
"}",
"method_models",
"=",
"{",
"}",
"if",
"'parameters'",
"in",
"method_data",
":",
"for",
"param",
"in",
"method_data",
"[",
"'parameters'"... | Helper function to construct the method request params, models, request_templates and
integration_type values needed to configure method request integration/mappings. | [
"Helper",
"function",
"to",
"construct",
"the",
"method",
"request",
"params",
"models",
"request_templates",
"and",
"integration_type",
"values",
"needed",
"to",
"configure",
"method",
"request",
"integration",
"/",
"mappings",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1458-L1479 | train | Helper function to construct the method request params models request_templates and integration_type values needed to configure method request integration / mappings. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._get_pattern_for_schema | def _get_pattern_for_schema(self, schema_name, httpStatus):
'''
returns the pattern specified in a response schema
'''
defaultPattern = '.+' if self._is_http_error_rescode(httpStatus) else '.*'
model = self._models().get(schema_name)
patterns = self._find_patterns(model)
... | python | def _get_pattern_for_schema(self, schema_name, httpStatus):
'''
returns the pattern specified in a response schema
'''
defaultPattern = '.+' if self._is_http_error_rescode(httpStatus) else '.*'
model = self._models().get(schema_name)
patterns = self._find_patterns(model)
... | [
"def",
"_get_pattern_for_schema",
"(",
"self",
",",
"schema_name",
",",
"httpStatus",
")",
":",
"defaultPattern",
"=",
"'.+'",
"if",
"self",
".",
"_is_http_error_rescode",
"(",
"httpStatus",
")",
"else",
"'.*'",
"model",
"=",
"self",
".",
"_models",
"(",
")",
... | returns the pattern specified in a response schema | [
"returns",
"the",
"pattern",
"specified",
"in",
"a",
"response",
"schema"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1492-L1499 | train | returns the pattern specified in a response schema | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._parse_method_response | def _parse_method_response(self, method_name, method_response, httpStatus):
'''
Helper function to construct the method response params, models, and integration_params
values needed to configure method response integration/mappings.
'''
method_response_models = {}
method_... | python | def _parse_method_response(self, method_name, method_response, httpStatus):
'''
Helper function to construct the method response params, models, and integration_params
values needed to configure method response integration/mappings.
'''
method_response_models = {}
method_... | [
"def",
"_parse_method_response",
"(",
"self",
",",
"method_name",
",",
"method_response",
",",
"httpStatus",
")",
":",
"method_response_models",
"=",
"{",
"}",
"method_response_pattern",
"=",
"'.*'",
"if",
"method_response",
".",
"schema",
":",
"method_response_models... | Helper function to construct the method response params, models, and integration_params
values needed to configure method response integration/mappings. | [
"Helper",
"function",
"to",
"construct",
"the",
"method",
"response",
"params",
"models",
"and",
"integration_params",
"values",
"needed",
"to",
"configure",
"method",
"response",
"integration",
"/",
"mappings",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1510-L1536 | train | Helper function to construct the method response params models and integration_params
values needed to configure method response integration and mappings. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger._deploy_method | def _deploy_method(self, ret, resource_path, method_name, method_data, api_key_required,
lambda_integration_role, lambda_region, authorization_type):
'''
Method to create a method for the given resource path, along with its associated
request and response integrations.
... | python | def _deploy_method(self, ret, resource_path, method_name, method_data, api_key_required,
lambda_integration_role, lambda_region, authorization_type):
'''
Method to create a method for the given resource path, along with its associated
request and response integrations.
... | [
"def",
"_deploy_method",
"(",
"self",
",",
"ret",
",",
"resource_path",
",",
"method_name",
",",
"method_data",
",",
"api_key_required",
",",
"lambda_integration_role",
",",
"lambda_region",
",",
"authorization_type",
")",
":",
"method",
"=",
"self",
".",
"_parse_... | Method to create a method for the given resource path, along with its associated
request and response integrations.
ret
a dictionary for returning status to Saltstack
resource_path
the full resource path where the named method_name will be associated with.
meth... | [
"Method",
"to",
"create",
"a",
"method",
"for",
"the",
"given",
"resource",
"path",
"along",
"with",
"its",
"associated",
"request",
"and",
"response",
"integrations",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1538-L1650 | train | Helper function to deploy a method to the API Gateway | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/boto_apigateway.py | _Swagger.deploy_resources | def deploy_resources(self, ret, api_key_required, lambda_integration_role, lambda_region, authorization_type):
'''
Method to deploy resources defined in the swagger file.
ret
a dictionary for returning status to Saltstack
api_key_required
True or False, whether ... | python | def deploy_resources(self, ret, api_key_required, lambda_integration_role, lambda_region, authorization_type):
'''
Method to deploy resources defined in the swagger file.
ret
a dictionary for returning status to Saltstack
api_key_required
True or False, whether ... | [
"def",
"deploy_resources",
"(",
"self",
",",
"ret",
",",
"api_key_required",
",",
"lambda_integration_role",
",",
"lambda_region",
",",
"authorization_type",
")",
":",
"for",
"path",
",",
"pathData",
"in",
"self",
".",
"paths",
":",
"resource",
"=",
"__salt__",
... | Method to deploy resources defined in the swagger file.
ret
a dictionary for returning status to Saltstack
api_key_required
True or False, whether api key is required to access this method.
lambda_integration_role
name of the IAM role or IAM role arn that A... | [
"Method",
"to",
"deploy",
"resources",
"defined",
"in",
"the",
"swagger",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_apigateway.py#L1652-L1685 | train | Method to deploy resources defined in the swagger file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pagerduty.py | create_event | def create_event(name, details, service_key, profile):
'''
Create an event on the PagerDuty service
.. code-block:: yaml
server-warning-message:
pagerduty.create_event:
- name: 'This is a server warning message'
- details: 'This is a much more detailed message'
... | python | def create_event(name, details, service_key, profile):
'''
Create an event on the PagerDuty service
.. code-block:: yaml
server-warning-message:
pagerduty.create_event:
- name: 'This is a server warning message'
- details: 'This is a much more detailed message'
... | [
"def",
"create_event",
"(",
"name",
",",
"details",
",",
"service_key",
",",
"profile",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"if",
"__opts__... | Create an event on the PagerDuty service
.. code-block:: yaml
server-warning-message:
pagerduty.create_event:
- name: 'This is a server warning message'
- details: 'This is a much more detailed message'
- service_key: 9abcd123456789efabcde362783cdbaf
... | [
"Create",
"an",
"event",
"on",
"the",
"PagerDuty",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty.py#L32-L75 | train | Create an event on the PagerDuty service | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/mysql_query.py | run_file | def run_file(name,
database,
query_file=None,
output=None,
grain=None,
key=None,
overwrite=True,
saltenv=None,
check_db_exists=True,
**connection_args):
'''
Execute an arbitrary query on the specified database
.. versionadded:: 2017.7.... | python | def run_file(name,
database,
query_file=None,
output=None,
grain=None,
key=None,
overwrite=True,
saltenv=None,
check_db_exists=True,
**connection_args):
'''
Execute an arbitrary query on the specified database
.. versionadded:: 2017.7.... | [
"def",
"run_file",
"(",
"name",
",",
"database",
",",
"query_file",
"=",
"None",
",",
"output",
"=",
"None",
",",
"grain",
"=",
"None",
",",
"key",
"=",
"None",
",",
"overwrite",
"=",
"True",
",",
"saltenv",
"=",
"None",
",",
"check_db_exists",
"=",
... | Execute an arbitrary query on the specified database
.. versionadded:: 2017.7.0
name
Used only as an ID
database
The name of the database to execute the query_file on
query_file
The file of mysql commands to run
output
grain: output in a grain
other: the ... | [
"Execute",
"an",
"arbitrary",
"query",
"on",
"the",
"specified",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_query.py#L53-L222 | train | Execute a mysql query on a database and store the result in a dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/mysql_query.py | run | def run(name,
database,
query,
output=None,
grain=None,
key=None,
overwrite=True,
check_db_exists=True,
**connection_args):
'''
Execute an arbitrary query on the specified database
name
Used only as an ID
database
The name... | python | def run(name,
database,
query,
output=None,
grain=None,
key=None,
overwrite=True,
check_db_exists=True,
**connection_args):
'''
Execute an arbitrary query on the specified database
name
Used only as an ID
database
The name... | [
"def",
"run",
"(",
"name",
",",
"database",
",",
"query",
",",
"output",
"=",
"None",
",",
"grain",
"=",
"None",
",",
"key",
"=",
"None",
",",
"overwrite",
"=",
"True",
",",
"check_db_exists",
"=",
"True",
",",
"*",
"*",
"connection_args",
")",
":",
... | Execute an arbitrary query on the specified database
name
Used only as an ID
database
The name of the database to execute the query on
query
The query to execute
output
grain: output in a grain
other: the file to store results
None: output to the resu... | [
"Execute",
"an",
"arbitrary",
"query",
"on",
"the",
"specified",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mysql_query.py#L225-L381 | train | Execute an arbitrary query on the specified database and store the result in a dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/s3.py | query | def query(key, keyid, method='GET', params=None, headers=None,
requesturl=None, return_url=False, bucket=None, service_url=None,
path='', return_bin=False, action=None, local_file=None,
verify_ssl=True, full_headers=False, kms_keyid=None,
location=None, role_arn=None, chunk_size=... | python | def query(key, keyid, method='GET', params=None, headers=None,
requesturl=None, return_url=False, bucket=None, service_url=None,
path='', return_bin=False, action=None, local_file=None,
verify_ssl=True, full_headers=False, kms_keyid=None,
location=None, role_arn=None, chunk_size=... | [
"def",
"query",
"(",
"key",
",",
"keyid",
",",
"method",
"=",
"'GET'",
",",
"params",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"requesturl",
"=",
"None",
",",
"return_url",
"=",
"False",
",",
"bucket",
"=",
"None",
",",
"service_url",
"=",
"Non... | Perform a query against an S3-like API. This function requires that a
secret key and the id for that key are passed in. For instance:
s3.keyid: GKTADJGHEIQSXMKKRBJ08H
s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
If keyid or key is not specified, an attempt to fetch them from EC2 IAM
m... | [
"Perform",
"a",
"query",
"against",
"an",
"S3",
"-",
"like",
"API",
".",
"This",
"function",
"requires",
"that",
"a",
"secret",
"key",
"and",
"the",
"id",
"for",
"that",
"key",
"are",
"passed",
"in",
".",
"For",
"instance",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/s3.py#L32-L279 | train | This function performs a query against an Amazon S3 key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/utils/atomicfile.py | atomic_open | def atomic_open(filename, mode='w'):
'''
Works like a regular `open()` but writes updates into a temporary
file instead of the given file and moves it over when the file is
closed. The file returned behaves as if it was a regular Python
'''
if mode in ('r', 'rb', 'r+', 'rb+', 'a', 'ab'):
... | python | def atomic_open(filename, mode='w'):
'''
Works like a regular `open()` but writes updates into a temporary
file instead of the given file and moves it over when the file is
closed. The file returned behaves as if it was a regular Python
'''
if mode in ('r', 'rb', 'r+', 'rb+', 'a', 'ab'):
... | [
"def",
"atomic_open",
"(",
"filename",
",",
"mode",
"=",
"'w'",
")",
":",
"if",
"mode",
"in",
"(",
"'r'",
",",
"'rb'",
",",
"'r+'",
",",
"'rb+'",
",",
"'a'",
",",
"'ab'",
")",
":",
"raise",
"TypeError",
"(",
"'Read or append modes don\\'t work with atomic_... | Works like a regular `open()` but writes updates into a temporary
file instead of the given file and moves it over when the file is
closed. The file returned behaves as if it was a regular Python | [
"Works",
"like",
"a",
"regular",
"open",
"()",
"but",
"writes",
"updates",
"into",
"a",
"temporary",
"file",
"instead",
"of",
"the",
"given",
"file",
"and",
"moves",
"it",
"over",
"when",
"the",
"file",
"is",
"closed",
".",
"The",
"file",
"returned",
"be... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/atomicfile.py#L153-L169 | train | Open a file in atomic mode. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/pillar/nodegroups.py | ext_pillar | def ext_pillar(minion_id, pillar, pillar_name=None):
'''
A salt external pillar which provides the list of nodegroups of which the minion is a member.
:param minion_id: used for compound matching nodegroups
:param pillar: provided by salt, but not used by nodegroups ext_pillar
:param pillar_name: o... | python | def ext_pillar(minion_id, pillar, pillar_name=None):
'''
A salt external pillar which provides the list of nodegroups of which the minion is a member.
:param minion_id: used for compound matching nodegroups
:param pillar: provided by salt, but not used by nodegroups ext_pillar
:param pillar_name: o... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"pillar_name",
"=",
"None",
")",
":",
"pillar_name",
"=",
"pillar_name",
"or",
"'nodegroups'",
"all_nodegroups",
"=",
"__opts__",
"[",
"'nodegroups'",
"]",
"nodegroups_minion_is_in",
"=",
"[",
"]",
"ckmi... | A salt external pillar which provides the list of nodegroups of which the minion is a member.
:param minion_id: used for compound matching nodegroups
:param pillar: provided by salt, but not used by nodegroups ext_pillar
:param pillar_name: optional name to use for the pillar, defaults to 'nodegroups'
... | [
"A",
"salt",
"external",
"pillar",
"which",
"provides",
"the",
"list",
"of",
"nodegroups",
"of",
"which",
"the",
"minion",
"is",
"a",
"member",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/nodegroups.py#L49-L73 | train | Return a dictionary of nodegroups which are in the minion | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | _compute_signature | def _compute_signature(parameters, access_key_secret, method, path):
'''
Generate an API request signature. Detailed document can be found at:
https://docs.qingcloud.com/api/common/signature.html
'''
parameters['signature_method'] = 'HmacSHA256'
string_to_sign = '{0}\n{1}\n'.format(method.uppe... | python | def _compute_signature(parameters, access_key_secret, method, path):
'''
Generate an API request signature. Detailed document can be found at:
https://docs.qingcloud.com/api/common/signature.html
'''
parameters['signature_method'] = 'HmacSHA256'
string_to_sign = '{0}\n{1}\n'.format(method.uppe... | [
"def",
"_compute_signature",
"(",
"parameters",
",",
"access_key_secret",
",",
"method",
",",
"path",
")",
":",
"parameters",
"[",
"'signature_method'",
"]",
"=",
"'HmacSHA256'",
"string_to_sign",
"=",
"'{0}\\n{1}\\n'",
".",
"format",
"(",
"method",
".",
"upper",
... | Generate an API request signature. Detailed document can be found at:
https://docs.qingcloud.com/api/common/signature.html | [
"Generate",
"an",
"API",
"request",
"signature",
".",
"Detailed",
"document",
"can",
"be",
"found",
"at",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L105-L128 | train | Compute a signature for the given request parameters. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | query | def query(params=None):
'''
Make a web call to QingCloud IaaS API.
'''
path = 'https://api.qingcloud.com/iaas/'
access_key_id = config.get_cloud_config_value(
'access_key_id', get_configured_provider(), __opts__, search_global=False
)
access_key_secret = config.get_cloud_config_valu... | python | def query(params=None):
'''
Make a web call to QingCloud IaaS API.
'''
path = 'https://api.qingcloud.com/iaas/'
access_key_id = config.get_cloud_config_value(
'access_key_id', get_configured_provider(), __opts__, search_global=False
)
access_key_secret = config.get_cloud_config_valu... | [
"def",
"query",
"(",
"params",
"=",
"None",
")",
":",
"path",
"=",
"'https://api.qingcloud.com/iaas/'",
"access_key_id",
"=",
"config",
".",
"get_cloud_config_value",
"(",
"'access_key_id'",
",",
"get_configured_provider",
"(",
")",
",",
"__opts__",
",",
"search_glo... | Make a web call to QingCloud IaaS API. | [
"Make",
"a",
"web",
"call",
"to",
"QingCloud",
"IaaS",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L131-L201 | train | Query the QingCloud IaaS API. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | avail_locations | def avail_locations(call=None):
'''
Return a dict of all available locations on the provider with
relevant data.
CLI Examples:
.. code-block:: bash
salt-cloud --list-locations my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations... | python | def avail_locations(call=None):
'''
Return a dict of all available locations on the provider with
relevant data.
CLI Examples:
.. code-block:: bash
salt-cloud --list-locations my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations... | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_locations function must be called with '",
"'-f or --function, or with the --list-locations option'",
")",
"params",
"=",
"{",... | Return a dict of all available locations on the provider with
relevant data.
CLI Examples:
.. code-block:: bash
salt-cloud --list-locations my-qingcloud | [
"Return",
"a",
"dict",
"of",
"all",
"available",
"locations",
"on",
"the",
"provider",
"with",
"relevant",
"data",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L204-L232 | train | Return a dict of all available locations on the provider with
relevant data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | avail_images | def avail_images(kwargs=None, call=None):
'''
Return a list of the images that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-images my-qingcloud
salt-cloud -f avail_images my-qingcloud zone=gd1
'''
if call == 'action':
raise SaltCloudSystemE... | python | def avail_images(kwargs=None, call=None):
'''
Return a list of the images that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-images my-qingcloud
salt-cloud -f avail_images my-qingcloud zone=gd1
'''
if call == 'action':
raise SaltCloudSystemE... | [
"def",
"avail_images",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_images function must be called with '",
"'-f or --function, or with the --list-images option'",
")"... | Return a list of the images that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-images my-qingcloud
salt-cloud -f avail_images my-qingcloud zone=gd1 | [
"Return",
"a",
"list",
"of",
"the",
"images",
"that",
"are",
"on",
"the",
"provider",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L271-L304 | train | Return a list of the images that are on the provider | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | show_image | def show_image(kwargs, call=None):
'''
Show the details from QingCloud concerning an image.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_image my-qingcloud image=trustysrvx64c
salt-cloud -f show_image my-qingcloud image=trustysrvx64c,coreos4
salt-cloud -f show_image m... | python | def show_image(kwargs, call=None):
'''
Show the details from QingCloud concerning an image.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_image my-qingcloud image=trustysrvx64c
salt-cloud -f show_image my-qingcloud image=trustysrvx64c,coreos4
salt-cloud -f show_image m... | [
"def",
"show_image",
"(",
"kwargs",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_images function must be called with '",
"'-f or --function'",
")",
"if",
"not",
"isinstance",
"(",
"kwargs"... | Show the details from QingCloud concerning an image.
CLI Examples:
.. code-block:: bash
salt-cloud -f show_image my-qingcloud image=trustysrvx64c
salt-cloud -f show_image my-qingcloud image=trustysrvx64c,coreos4
salt-cloud -f show_image my-qingcloud image=trustysrvx64c zone=ap1 | [
"Show",
"the",
"details",
"from",
"QingCloud",
"concerning",
"an",
"image",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L327-L368 | train | Show the details from QingCloud concerning an image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | avail_sizes | def avail_sizes(kwargs=None, call=None):
'''
Return a list of the instance sizes that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-sizes my-qingcloud
salt-cloud -f avail_sizes my-qingcloud zone=pek2
'''
if call == 'action':
raise SaltCloudS... | python | def avail_sizes(kwargs=None, call=None):
'''
Return a list of the instance sizes that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-sizes my-qingcloud
salt-cloud -f avail_sizes my-qingcloud zone=pek2
'''
if call == 'action':
raise SaltCloudS... | [
"def",
"avail_sizes",
"(",
"kwargs",
"=",
"None",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The avail_sizes function must be called with '",
"'-f or --function, or with the --list-sizes option'",
")",
... | Return a list of the instance sizes that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud --list-sizes my-qingcloud
salt-cloud -f avail_sizes my-qingcloud zone=pek2 | [
"Return",
"a",
"list",
"of",
"the",
"instance",
"sizes",
"that",
"are",
"on",
"the",
"provider",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L399-L424 | train | Return a list of the instance sizes that are on the provider. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | _show_normalized_node | def _show_normalized_node(full_node):
'''
Normalize the QingCloud instance data. Used by list_nodes()-related
functions.
'''
public_ips = full_node.get('eip', [])
if public_ips:
public_ip = public_ips['eip_addr']
public_ips = [public_ip, ]
private_ips = []
for vxnet in f... | python | def _show_normalized_node(full_node):
'''
Normalize the QingCloud instance data. Used by list_nodes()-related
functions.
'''
public_ips = full_node.get('eip', [])
if public_ips:
public_ip = public_ips['eip_addr']
public_ips = [public_ip, ]
private_ips = []
for vxnet in f... | [
"def",
"_show_normalized_node",
"(",
"full_node",
")",
":",
"public_ips",
"=",
"full_node",
".",
"get",
"(",
"'eip'",
",",
"[",
"]",
")",
"if",
"public_ips",
":",
"public_ip",
"=",
"public_ips",
"[",
"'eip_addr'",
"]",
"public_ips",
"=",
"[",
"public_ip",
... | Normalize the QingCloud instance data. Used by list_nodes()-related
functions. | [
"Normalize",
"the",
"QingCloud",
"instance",
"data",
".",
"Used",
"by",
"list_nodes",
"()",
"-",
"related",
"functions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L448-L473 | train | Normalize the QingCloud instance data. Used by list_nodes() - related
functions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | list_nodes_full | def list_nodes_full(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -F my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --... | python | def list_nodes_full(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -F my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --... | [
"def",
"list_nodes_full",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_full function must be called with -f or --function.'",
")",
"zone",
"=",
"_get_specified_zone",
"(",
")",
"params",
... | Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -F my-qingcloud | [
"Return",
"a",
"list",
"of",
"the",
"instances",
"that",
"are",
"on",
"the",
"provider",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L476-L521 | train | Return a list of the instances that are on the provider. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | list_nodes | def list_nodes(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -Q my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'... | python | def list_nodes(call=None):
'''
Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -Q my-qingcloud
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'... | [
"def",
"list_nodes",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes function must be called with -f or --function.'",
")",
"nodes",
"=",
"list_nodes_full",
"(",
")",
"ret",
"=",
"{",
"... | Return a list of the instances that are on the provider.
CLI Examples:
.. code-block:: bash
salt-cloud -Q my-qingcloud | [
"Return",
"a",
"list",
"of",
"the",
"instances",
"that",
"are",
"on",
"the",
"provider",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L524-L552 | train | Return a list of the instances that are on the provider. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | list_nodes_min | def list_nodes_min(call=None):
'''
Return a list of the instances that are on the provider. Only a list of
instances names, and their state, is returned.
CLI Examples:
.. code-block:: bash
salt-cloud -f list_nodes_min my-qingcloud
'''
if call != 'function':
raise SaltCloud... | python | def list_nodes_min(call=None):
'''
Return a list of the instances that are on the provider. Only a list of
instances names, and their state, is returned.
CLI Examples:
.. code-block:: bash
salt-cloud -f list_nodes_min my-qingcloud
'''
if call != 'function':
raise SaltCloud... | [
"def",
"list_nodes_min",
"(",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_min function must be called with -f or --function.'",
")",
"nodes",
"=",
"list_nodes_full",
"(",
")",
"result",
"=... | Return a list of the instances that are on the provider. Only a list of
instances names, and their state, is returned.
CLI Examples:
.. code-block:: bash
salt-cloud -f list_nodes_min my-qingcloud | [
"Return",
"a",
"list",
"of",
"the",
"instances",
"that",
"are",
"on",
"the",
"provider",
".",
"Only",
"a",
"list",
"of",
"instances",
"names",
"and",
"their",
"state",
"is",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L555-L580 | train | Return a list of the instances that are on the provider. Only a list of the instances names and their state is returned. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | show_instance | def show_instance(instance_id, call=None, kwargs=None):
'''
Show the details from QingCloud concerning an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a show_instance i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance acti... | python | def show_instance(instance_id, call=None, kwargs=None):
'''
Show the details from QingCloud concerning an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a show_instance i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The show_instance acti... | [
"def",
"show_instance",
"(",
"instance_id",
",",
"call",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The show_instance action must be called with -a or --action.'",
")",
"params",
"="... | Show the details from QingCloud concerning an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a show_instance i-2f733r5n | [
"Show",
"the",
"details",
"from",
"QingCloud",
"concerning",
"an",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L601-L634 | train | Show details from QingCloud concerning an instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | create | def create(vm_):
'''
Create a single instance from a data dict.
CLI Examples:
.. code-block:: bash
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P
'''
try:
# Check for required profile parameters before sending any API calls.
i... | python | def create(vm_):
'''
Create a single instance from a data dict.
CLI Examples:
.. code-block:: bash
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P
'''
try:
# Check for required profile parameters before sending any API calls.
i... | [
"def",
"create",
"(",
"vm_",
")",
":",
"try",
":",
"# Check for required profile parameters before sending any API calls.",
"if",
"vm_",
"[",
"'profile'",
"]",
"and",
"config",
".",
"is_profile_configured",
"(",
"__opts__",
",",
"__active_provider_name__",
"or",
"'qingc... | Create a single instance from a data dict.
CLI Examples:
.. code-block:: bash
salt-cloud -p qingcloud-ubuntu-c1m1 hostname1
salt-cloud -m /path/to/mymap.sls -P | [
"Create",
"a",
"single",
"instance",
"from",
"a",
"data",
"dict",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L647-L747 | train | Create a single instance from a data dict. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | start | def start(instance_id, call=None):
'''
Start an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a start i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --action.'
)
log.info('Starting i... | python | def start(instance_id, call=None):
'''
Start an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a start i-2f733r5n
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be called with -a or --action.'
)
log.info('Starting i... | [
"def",
"start",
"(",
"instance_id",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"log",
".",
"info",
"(",
"'Starting instance %s'",
",",
... | Start an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a start i-2f733r5n | [
"Start",
"an",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L766-L790 | train | Start an instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | stop | def stop(instance_id, force=False, call=None):
'''
Stop an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a stop i-2f733r5n
salt-cloud -a stop i-2f733r5n force=True
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be calle... | python | def stop(instance_id, force=False, call=None):
'''
Stop an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a stop i-2f733r5n
salt-cloud -a stop i-2f733r5n force=True
'''
if call != 'action':
raise SaltCloudSystemExit(
'The stop action must be calle... | [
"def",
"stop",
"(",
"instance_id",
",",
"force",
"=",
"False",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"!=",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The stop action must be called with -a or --action.'",
")",
"log",
".",
"info",
"(",
... | Stop an instance.
CLI Examples:
.. code-block:: bash
salt-cloud -a stop i-2f733r5n
salt-cloud -a stop i-2f733r5n force=True | [
"Stop",
"an",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L793-L819 | train | Stop an instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/cloud/clouds/qingcloud.py | destroy | def destroy(instance_id, call=None):
'''
Destroy an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a destroy i-2f733r5n
salt-cloud -d i-2f733r5n
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --des... | python | def destroy(instance_id, call=None):
'''
Destroy an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a destroy i-2f733r5n
salt-cloud -d i-2f733r5n
'''
if call == 'function':
raise SaltCloudSystemExit(
'The destroy action must be called with -d, --des... | [
"def",
"destroy",
"(",
"instance_id",
",",
"call",
"=",
"None",
")",
":",
"if",
"call",
"==",
"'function'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The destroy action must be called with -d, --destroy, '",
"'-a or --action.'",
")",
"instance_data",
"=",
"show_instan... | Destroy an instance.
CLI Example:
.. code-block:: bash
salt-cloud -a destroy i-2f733r5n
salt-cloud -d i-2f733r5n | [
"Destroy",
"an",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/qingcloud.py#L849-L894 | train | Destroy an instance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/grafana4_org.py | present | def present(name,
users=None,
theme=None,
home_dashboard_id=None,
timezone=None,
address1=None,
address2=None,
city=None,
zip_code=None,
address_state=None,
country=None,
profile='grafana'... | python | def present(name,
users=None,
theme=None,
home_dashboard_id=None,
timezone=None,
address1=None,
address2=None,
city=None,
zip_code=None,
address_state=None,
country=None,
profile='grafana'... | [
"def",
"present",
"(",
"name",
",",
"users",
"=",
"None",
",",
"theme",
"=",
"None",
",",
"home_dashboard_id",
"=",
"None",
",",
"timezone",
"=",
"None",
",",
"address1",
"=",
"None",
",",
"address2",
"=",
"None",
",",
"city",
"=",
"None",
",",
"zip_... | Ensure that an organization is present.
name
Name of the org.
users
Optional - Dict of user/role associated with the org. Example:
.. code-block:: yaml
users:
foo: Viewer
bar: Editor
theme
Optional - Selected theme for the org.
... | [
"Ensure",
"that",
"an",
"organization",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_org.py#L60-L217 | train | Ensure that the named organization is present. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/grafana4_org.py | absent | def absent(name, profile='grafana'):
'''
Ensure that a org is present.
name
Name of the org to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'.
'''
if isinstance(profile, string_types):
profile = __salt__['conf... | python | def absent(name, profile='grafana'):
'''
Ensure that a org is present.
name
Name of the org to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'.
'''
if isinstance(profile, string_types):
profile = __salt__['conf... | [
"def",
"absent",
"(",
"name",
",",
"profile",
"=",
"'grafana'",
")",
":",
"if",
"isinstance",
"(",
"profile",
",",
"string_types",
")",
":",
"profile",
"=",
"__salt__",
"[",
"'config.option'",
"]",
"(",
"profile",
")",
"ret",
"=",
"{",
"'name'",
":",
"... | Ensure that a org is present.
name
Name of the org to remove.
profile
Configuration profile used to connect to the Grafana instance.
Default is 'grafana'. | [
"Ensure",
"that",
"a",
"org",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana4_org.py#L220-L251 | train | Ensure that a org is absent. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/ansiblegate.py | _changes | def _changes(plays):
'''
Find changes in ansible return data
'''
changes = {}
for play in plays['plays']:
task_changes = {}
for task in play['tasks']:
host_changes = {}
for host, data in six.iteritems(task['hosts']):
if data['changed'] is True:... | python | def _changes(plays):
'''
Find changes in ansible return data
'''
changes = {}
for play in plays['plays']:
task_changes = {}
for task in play['tasks']:
host_changes = {}
for host, data in six.iteritems(task['hosts']):
if data['changed'] is True:... | [
"def",
"_changes",
"(",
"plays",
")",
":",
"changes",
"=",
"{",
"}",
"for",
"play",
"in",
"plays",
"[",
"'plays'",
"]",
":",
"task_changes",
"=",
"{",
"}",
"for",
"task",
"in",
"play",
"[",
"'tasks'",
"]",
":",
"host_changes",
"=",
"{",
"}",
"for",... | Find changes in ansible return data | [
"Find",
"changes",
"in",
"ansible",
"return",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ansiblegate.py#L114-L130 | train | Find changes in ansible return data
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/ansiblegate.py | playbooks | def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=None):
'''
Run Ansible Playbooks
:param name: path to playbook. This can be relative to rundir or the git repo
:param rundir: location to run ansible-playbook from.
:param git_repo: git repository to clone for ansible p... | python | def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs=None):
'''
Run Ansible Playbooks
:param name: path to playbook. This can be relative to rundir or the git repo
:param rundir: location to run ansible-playbook from.
:param git_repo: git repository to clone for ansible p... | [
"def",
"playbooks",
"(",
"name",
",",
"rundir",
"=",
"None",
",",
"git_repo",
"=",
"None",
",",
"git_kwargs",
"=",
"None",
",",
"ansible_kwargs",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'changes'",
":",
"{",
"}",
",",
... | Run Ansible Playbooks
:param name: path to playbook. This can be relative to rundir or the git repo
:param rundir: location to run ansible-playbook from.
:param git_repo: git repository to clone for ansible playbooks. This is cloned
using the `git.latest` state, and is cloned to the `... | [
"Run",
"Ansible",
"Playbooks"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ansiblegate.py#L134-L196 | train | Run an ansible - playbook from a directory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _clear_community_details | def _clear_community_details(community_details):
'''
Clears community details.
'''
for key in ['acl', 'mode']:
_str_elem(community_details, key)
_mode = community_details.get['mode'] = community_details.get('mode').lower()
if _mode in _COMMUNITY_MODE_MAP.keys():
community_det... | python | def _clear_community_details(community_details):
'''
Clears community details.
'''
for key in ['acl', 'mode']:
_str_elem(community_details, key)
_mode = community_details.get['mode'] = community_details.get('mode').lower()
if _mode in _COMMUNITY_MODE_MAP.keys():
community_det... | [
"def",
"_clear_community_details",
"(",
"community_details",
")",
":",
"for",
"key",
"in",
"[",
"'acl'",
",",
"'mode'",
"]",
":",
"_str_elem",
"(",
"community_details",
",",
"key",
")",
"_mode",
"=",
"community_details",
".",
"get",
"[",
"'mode'",
"]",
"=",
... | Clears community details. | [
"Clears",
"community",
"details",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L113-L130 | train | Clears the community details. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _str_elem | def _str_elem(config, key):
'''
Re-adds the value of a specific key in the dict, only in case of valid str value.
'''
_value = config.pop(key, '')
if _valid_str(_value):
config[key] = _value | python | def _str_elem(config, key):
'''
Re-adds the value of a specific key in the dict, only in case of valid str value.
'''
_value = config.pop(key, '')
if _valid_str(_value):
config[key] = _value | [
"def",
"_str_elem",
"(",
"config",
",",
"key",
")",
":",
"_value",
"=",
"config",
".",
"pop",
"(",
"key",
",",
"''",
")",
"if",
"_valid_str",
"(",
"_value",
")",
":",
"config",
"[",
"key",
"]",
"=",
"_value"
] | Re-adds the value of a specific key in the dict, only in case of valid str value. | [
"Re",
"-",
"adds",
"the",
"value",
"of",
"a",
"specific",
"key",
"in",
"the",
"dict",
"only",
"in",
"case",
"of",
"valid",
"str",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L133-L141 | train | Re - adds the value of a specific key in the dict only in case of valid str value. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _check_config | def _check_config(config):
'''
Checks the desired config and clears interesting details.
'''
if not _valid_dict(config):
return True, ''
_community = config.get('community')
_community_tmp = {}
if not _community:
return False, 'Must specify at least a community.'
if _v... | python | def _check_config(config):
'''
Checks the desired config and clears interesting details.
'''
if not _valid_dict(config):
return True, ''
_community = config.get('community')
_community_tmp = {}
if not _community:
return False, 'Must specify at least a community.'
if _v... | [
"def",
"_check_config",
"(",
"config",
")",
":",
"if",
"not",
"_valid_dict",
"(",
"config",
")",
":",
"return",
"True",
",",
"''",
"_community",
"=",
"config",
".",
"get",
"(",
"'community'",
")",
"_community_tmp",
"=",
"{",
"}",
"if",
"not",
"_community... | Checks the desired config and clears interesting details. | [
"Checks",
"the",
"desired",
"config",
"and",
"clears",
"interesting",
"details",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L144-L189 | train | Checks the desired config and clears interesting details. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _create_diff_action | def _create_diff_action(diff, diff_key, key, value):
'''
DRY to build diff parts (added, removed, updated).
'''
if diff_key not in diff.keys():
diff[diff_key] = {}
diff[diff_key][key] = value | python | def _create_diff_action(diff, diff_key, key, value):
'''
DRY to build diff parts (added, removed, updated).
'''
if diff_key not in diff.keys():
diff[diff_key] = {}
diff[diff_key][key] = value | [
"def",
"_create_diff_action",
"(",
"diff",
",",
"diff_key",
",",
"key",
",",
"value",
")",
":",
"if",
"diff_key",
"not",
"in",
"diff",
".",
"keys",
"(",
")",
":",
"diff",
"[",
"diff_key",
"]",
"=",
"{",
"}",
"diff",
"[",
"diff_key",
"]",
"[",
"key"... | DRY to build diff parts (added, removed, updated). | [
"DRY",
"to",
"build",
"diff",
"parts",
"(",
"added",
"removed",
"updated",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L201-L209 | train | Create a diff action. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _create_diff | def _create_diff(diff, fun, key, prev, curr):
'''
Builds the diff dictionary.
'''
if not fun(prev):
_create_diff_action(diff, 'added', key, curr)
elif fun(prev) and not fun(curr):
_create_diff_action(diff, 'removed', key, prev)
elif not fun(curr):
_create_diff_action(di... | python | def _create_diff(diff, fun, key, prev, curr):
'''
Builds the diff dictionary.
'''
if not fun(prev):
_create_diff_action(diff, 'added', key, curr)
elif fun(prev) and not fun(curr):
_create_diff_action(diff, 'removed', key, prev)
elif not fun(curr):
_create_diff_action(di... | [
"def",
"_create_diff",
"(",
"diff",
",",
"fun",
",",
"key",
",",
"prev",
",",
"curr",
")",
":",
"if",
"not",
"fun",
"(",
"prev",
")",
":",
"_create_diff_action",
"(",
"diff",
",",
"'added'",
",",
"key",
",",
"curr",
")",
"elif",
"fun",
"(",
"prev",... | Builds the diff dictionary. | [
"Builds",
"the",
"diff",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L212-L223 | train | Builds the diff dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _compute_diff | def _compute_diff(existing, expected):
'''
Computes the differences between the existing and the expected SNMP config.
'''
diff = {}
for key in ['location', 'contact', 'chassis_id']:
if existing.get(key) != expected.get(key):
_create_diff(diff,
_valid_... | python | def _compute_diff(existing, expected):
'''
Computes the differences between the existing and the expected SNMP config.
'''
diff = {}
for key in ['location', 'contact', 'chassis_id']:
if existing.get(key) != expected.get(key):
_create_diff(diff,
_valid_... | [
"def",
"_compute_diff",
"(",
"existing",
",",
"expected",
")",
":",
"diff",
"=",
"{",
"}",
"for",
"key",
"in",
"[",
"'location'",
",",
"'contact'",
",",
"'chassis_id'",
"]",
":",
"if",
"existing",
".",
"get",
"(",
"key",
")",
"!=",
"expected",
".",
"... | Computes the differences between the existing and the expected SNMP config. | [
"Computes",
"the",
"differences",
"between",
"the",
"existing",
"and",
"the",
"expected",
"SNMP",
"config",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L226-L250 | train | Computes the differences between the existing and the expected SNMP config. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | _configure | def _configure(changes):
'''
Calls the configuration template to apply the configuration changes on the device.
'''
cfgred = True
reasons = []
fun = 'update_config'
for key in ['added', 'updated', 'removed']:
_updated_changes = changes.get(key, {})
if not _updated_changes:... | python | def _configure(changes):
'''
Calls the configuration template to apply the configuration changes on the device.
'''
cfgred = True
reasons = []
fun = 'update_config'
for key in ['added', 'updated', 'removed']:
_updated_changes = changes.get(key, {})
if not _updated_changes:... | [
"def",
"_configure",
"(",
"changes",
")",
":",
"cfgred",
"=",
"True",
"reasons",
"=",
"[",
"]",
"fun",
"=",
"'update_config'",
"for",
"key",
"in",
"[",
"'added'",
",",
"'updated'",
",",
"'removed'",
"]",
":",
"_updated_changes",
"=",
"changes",
".",
"get... | Calls the configuration template to apply the configuration changes on the device. | [
"Calls",
"the",
"configuration",
"template",
"to",
"apply",
"the",
"configuration",
"changes",
"on",
"the",
"device",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L253-L285 | train | Configure the NICs on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/netsnmp.py | managed | def managed(name, config=None, defaults=None):
'''
Configures the SNMP on the device as specified in the SLS file.
SLS Example:
.. code-block:: yaml
snmp_example:
netsnmp.managed:
- config:
location: Honolulu, HI, US
- default... | python | def managed(name, config=None, defaults=None):
'''
Configures the SNMP on the device as specified in the SLS file.
SLS Example:
.. code-block:: yaml
snmp_example:
netsnmp.managed:
- config:
location: Honolulu, HI, US
- default... | [
"def",
"managed",
"(",
"name",
",",
"config",
"=",
"None",
",",
"defaults",
"=",
"None",
")",
":",
"result",
"=",
"False",
"comment",
"=",
"''",
"changes",
"=",
"{",
"}",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"changes",
","... | Configures the SNMP on the device as specified in the SLS file.
SLS Example:
.. code-block:: yaml
snmp_example:
netsnmp.managed:
- config:
location: Honolulu, HI, US
- defaults:
contact: noc@cloudflare.com
Outp... | [
"Configures",
"the",
"SNMP",
"on",
"the",
"device",
"as",
"specified",
"in",
"the",
"SLS",
"file",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/netsnmp.py#L292-L426 | train | This function is used to configure the SNMP on the device. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | _fulfills_version_spec | def _fulfills_version_spec(version, version_spec):
'''
Check version number against version specification info and return a
boolean value based on whether or not the version number meets the
specified version.
'''
for oper, spec in version_spec:
if oper is None:
continue
... | python | def _fulfills_version_spec(version, version_spec):
'''
Check version number against version specification info and return a
boolean value based on whether or not the version number meets the
specified version.
'''
for oper, spec in version_spec:
if oper is None:
continue
... | [
"def",
"_fulfills_version_spec",
"(",
"version",
",",
"version_spec",
")",
":",
"for",
"oper",
",",
"spec",
"in",
"version_spec",
":",
"if",
"oper",
"is",
"None",
":",
"continue",
"if",
"not",
"salt",
".",
"utils",
".",
"versions",
".",
"compare",
"(",
"... | Check version number against version specification info and return a
boolean value based on whether or not the version number meets the
specified version. | [
"Check",
"version",
"number",
"against",
"version",
"specification",
"info",
"and",
"return",
"a",
"boolean",
"value",
"based",
"on",
"whether",
"or",
"not",
"the",
"version",
"number",
"meets",
"the",
"specified",
"version",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L92-L103 | train | Check version number against version specification info and return a
boolean value based on whether or not the version number meets the version specification info. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | _check_pkg_version_format | def _check_pkg_version_format(pkg):
'''
Takes a package name and version specification (if any) and checks it using
the pip library.
'''
ret = {'result': False, 'comment': None,
'prefix': None, 'version_spec': None}
if not HAS_PIP:
ret['comment'] = (
'An importab... | python | def _check_pkg_version_format(pkg):
'''
Takes a package name and version specification (if any) and checks it using
the pip library.
'''
ret = {'result': False, 'comment': None,
'prefix': None, 'version_spec': None}
if not HAS_PIP:
ret['comment'] = (
'An importab... | [
"def",
"_check_pkg_version_format",
"(",
"pkg",
")",
":",
"ret",
"=",
"{",
"'result'",
":",
"False",
",",
"'comment'",
":",
"None",
",",
"'prefix'",
":",
"None",
",",
"'version_spec'",
":",
"None",
"}",
"if",
"not",
"HAS_PIP",
":",
"ret",
"[",
"'comment'... | Takes a package name and version specification (if any) and checks it using
the pip library. | [
"Takes",
"a",
"package",
"name",
"and",
"version",
"specification",
"(",
"if",
"any",
")",
"and",
"checks",
"it",
"using",
"the",
"pip",
"library",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L106-L181 | train | Checks that a package name and version specification is properly parsed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | _check_if_installed | def _check_if_installed(prefix,
state_pkg_name,
version_spec,
ignore_installed,
force_reinstall,
upgrade,
user,
cwd,
bin_env,
... | python | def _check_if_installed(prefix,
state_pkg_name,
version_spec,
ignore_installed,
force_reinstall,
upgrade,
user,
cwd,
bin_env,
... | [
"def",
"_check_if_installed",
"(",
"prefix",
",",
"state_pkg_name",
",",
"version_spec",
",",
"ignore_installed",
",",
"force_reinstall",
",",
"upgrade",
",",
"user",
",",
"cwd",
",",
"bin_env",
",",
"env_vars",
",",
"index_url",
",",
"extra_index_url",
",",
"pi... | Takes a package name and version specification (if any) and checks it is
installed
Keyword arguments include:
pip_list: optional dict of installed pip packages, and their versions,
to search through to check if the package is installed. If not
provided, one will be generated in ... | [
"Takes",
"a",
"package",
"name",
"and",
"version",
"specification",
"(",
"if",
"any",
")",
"and",
"checks",
"it",
"is",
"installed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L184-L273 | train | Checks if a Python package is installed with the currently - installed version. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | _pep440_version_cmp | def _pep440_version_cmp(pkg1, pkg2, ignore_epoch=False):
'''
Compares two version strings using pkg_resources.parse_version.
Return -1 if version1 < version2, 0 if version1 ==version2,
and 1 if version1 > version2. Return None if there was a problem
making the comparison.
'''
normalize = lam... | python | def _pep440_version_cmp(pkg1, pkg2, ignore_epoch=False):
'''
Compares two version strings using pkg_resources.parse_version.
Return -1 if version1 < version2, 0 if version1 ==version2,
and 1 if version1 > version2. Return None if there was a problem
making the comparison.
'''
normalize = lam... | [
"def",
"_pep440_version_cmp",
"(",
"pkg1",
",",
"pkg2",
",",
"ignore_epoch",
"=",
"False",
")",
":",
"normalize",
"=",
"lambda",
"x",
":",
"six",
".",
"text_type",
"(",
"x",
")",
".",
"split",
"(",
"'!'",
",",
"1",
")",
"[",
"-",
"1",
"]",
"if",
... | Compares two version strings using pkg_resources.parse_version.
Return -1 if version1 < version2, 0 if version1 ==version2,
and 1 if version1 > version2. Return None if there was a problem
making the comparison. | [
"Compares",
"two",
"version",
"strings",
"using",
"pkg_resources",
".",
"parse_version",
".",
"Return",
"-",
"1",
"if",
"version1",
"<",
"version2",
"0",
"if",
"version1",
"==",
"version2",
"and",
"1",
"if",
"version1",
">",
"version2",
".",
"Return",
"None"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L276-L297 | train | Compares two version strings using pkg_resources. parse_version. Returns - 1 if version1 < version2 0 if version1 > version2 Return 1 if version1 > version2 Return None if there was a problem with the comparison. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | installed | def installed(name,
pkgs=None,
pip_bin=None,
requirements=None,
bin_env=None,
use_wheel=False,
no_use_wheel=False,
log=None,
proxy=None,
timeout=None,
repo=None,
edit... | python | def installed(name,
pkgs=None,
pip_bin=None,
requirements=None,
bin_env=None,
use_wheel=False,
no_use_wheel=False,
log=None,
proxy=None,
timeout=None,
repo=None,
edit... | [
"def",
"installed",
"(",
"name",
",",
"pkgs",
"=",
"None",
",",
"pip_bin",
"=",
"None",
",",
"requirements",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"use_wheel",
"=",
"False",
",",
"no_use_wheel",
"=",
"False",
",",
"log",
"=",
"None",
",",
"p... | Make sure the package is installed
name
The name of the python package to install. You can also specify version
numbers here using the standard operators ``==, >=, <=``. If
``requirements`` is given, this parameter will be ignored.
Example:
.. code-block:: yaml
django:
... | [
"Make",
"sure",
"the",
"package",
"is",
"installed"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L300-L961 | train | This function installs a python package into the pip package. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | removed | def removed(name,
requirements=None,
bin_env=None,
log=None,
proxy=None,
timeout=None,
user=None,
cwd=None,
use_vt=False):
'''
Make sure that a package is not installed.
name
The name of the package to u... | python | def removed(name,
requirements=None,
bin_env=None,
log=None,
proxy=None,
timeout=None,
user=None,
cwd=None,
use_vt=False):
'''
Make sure that a package is not installed.
name
The name of the package to u... | [
"def",
"removed",
"(",
"name",
",",
"requirements",
"=",
"None",
",",
"bin_env",
"=",
"None",
",",
"log",
"=",
"None",
",",
"proxy",
"=",
"None",
",",
"timeout",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"use_vt",
"=",
... | Make sure that a package is not installed.
name
The name of the package to uninstall
user
The user under which to run pip
bin_env : None
the pip executable or virtualenenv to use
use_vt
Use VT terminal emulation (see output while installing) | [
"Make",
"sure",
"that",
"a",
"package",
"is",
"not",
"installed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L964-L1019 | train | Ensure that a package is not installed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | uptodate | def uptodate(name,
bin_env=None,
user=None,
cwd=None,
use_vt=False):
'''
.. versionadded:: 2015.5.0
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
us... | python | def uptodate(name,
bin_env=None,
user=None,
cwd=None,
use_vt=False):
'''
.. versionadded:: 2015.5.0
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
us... | [
"def",
"uptodate",
"(",
"name",
",",
"bin_env",
"=",
"None",
",",
"user",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"use_vt",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
... | .. versionadded:: 2015.5.0
Verify that the system is completely up to date.
name
The name has no functional value and is only used as a tracking
reference
user
The user under which to run pip
bin_env
the pip executable or virtualenenv to use
use_vt
Use VT te... | [
"..",
"versionadded",
"::",
"2015",
".",
"5",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L1022-L1073 | train | Verify that the named system is up to date. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/pip_state.py | mod_aggregate | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data
'''
pkgs = []
pkg_type = None
agg_enabled = [
'installed',
'removed',
]
if lo... | python | def mod_aggregate(low, chunks, running):
'''
The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data
'''
pkgs = []
pkg_type = None
agg_enabled = [
'installed',
'removed',
]
if lo... | [
"def",
"mod_aggregate",
"(",
"low",
",",
"chunks",
",",
"running",
")",
":",
"pkgs",
"=",
"[",
"]",
"pkg_type",
"=",
"None",
"agg_enabled",
"=",
"[",
"'installed'",
",",
"'removed'",
",",
"]",
"if",
"low",
".",
"get",
"(",
"'fun'",
")",
"not",
"in",
... | The mod_aggregate function which looks up all packages in the available
low chunks and merges them into a single pkgs ref in the present low data | [
"The",
"mod_aggregate",
"function",
"which",
"looks",
"up",
"all",
"packages",
"in",
"the",
"available",
"low",
"chunks",
"and",
"merges",
"them",
"into",
"a",
"single",
"pkgs",
"ref",
"in",
"the",
"present",
"low",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pip_state.py#L1076-L1121 | train | This function is used to aggregate all packages in the available low data and return a single low data structure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/cloud.py | present | def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs):
'''
Spin up a single instance on a cloud provider, using salt-cloud. This state
does not take a profile argument; rather, it takes the arguments that would
normally be configured as part of the state.
Note that while ... | python | def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs):
'''
Spin up a single instance on a cloud provider, using salt-cloud. This state
does not take a profile argument; rather, it takes the arguments that would
normally be configured as part of the state.
Note that while ... | [
"def",
"present",
"(",
"name",
",",
"cloud_provider",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",... | Spin up a single instance on a cloud provider, using salt-cloud. This state
does not take a profile argument; rather, it takes the arguments that would
normally be configured as part of the state.
Note that while this function does take any configuration argument that
would normally be used to create a... | [
"Spin",
"up",
"a",
"single",
"instance",
"on",
"a",
"cloud",
"provider",
"using",
"salt",
"-",
"cloud",
".",
"This",
"state",
"does",
"not",
"take",
"a",
"profile",
"argument",
";",
"rather",
"it",
"takes",
"the",
"arguments",
"that",
"would",
"normally",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L67-L150 | train | Ensure that the named instance is present on a cloud provider. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/cloud.py | absent | def absent(name, onlyif=None, unless=None):
'''
Ensure that no instances with the specified names exist.
CAUTION: This is a destructive state, which will search all
configured cloud providers for the named instance,
and destroy it.
name
The name of the instance to destroy
onlyif
... | python | def absent(name, onlyif=None, unless=None):
'''
Ensure that no instances with the specified names exist.
CAUTION: This is a destructive state, which will search all
configured cloud providers for the named instance,
and destroy it.
name
The name of the instance to destroy
onlyif
... | [
"def",
"absent",
"(",
"name",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"retcode",
"=... | Ensure that no instances with the specified names exist.
CAUTION: This is a destructive state, which will search all
configured cloud providers for the named instance,
and destroy it.
name
The name of the instance to destroy
onlyif
Do run the state only if is unless succeed
u... | [
"Ensure",
"that",
"no",
"instances",
"with",
"the",
"specified",
"names",
"exist",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L153-L215 | train | Ensure that the named instance is absent. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
saltstack/salt | salt/states/cloud.py | profile | def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs):
'''
Create a single instance on a cloud provider, using a salt-cloud profile.
Note that while profiles used this function do take any configuration
argument that would normally be used to create an instance using a profile,
... | python | def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs):
'''
Create a single instance on a cloud provider, using a salt-cloud profile.
Note that while profiles used this function do take any configuration
argument that would normally be used to create an instance using a profile,
... | [
"def",
"profile",
"(",
"name",
",",
"profile",
",",
"onlyif",
"=",
"None",
",",
"unless",
"=",
"None",
",",
"opts",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'... | Create a single instance on a cloud provider, using a salt-cloud profile.
Note that while profiles used this function do take any configuration
argument that would normally be used to create an instance using a profile,
this state will not verify the state of any of those arguments on an
existing insta... | [
"Create",
"a",
"single",
"instance",
"on",
"a",
"cloud",
"provider",
"using",
"a",
"salt",
"-",
"cloud",
"profile",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/cloud.py#L218-L313 | train | Create a single instance on a cloud provider using a salt - cloud profile | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.