repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.edit_dedicated_fwl_rules | def edit_dedicated_fwl_rules(self, firewall_id, rules):
"""Edit the rules for dedicated firewall.
:param integer firewall_id: the instance ID of the dedicated firewall
:param list rules: the rules to be pushed on the firewall as defined by
SoftLayer_Network_Firewall_U... | python | def edit_dedicated_fwl_rules(self, firewall_id, rules):
"""Edit the rules for dedicated firewall.
:param integer firewall_id: the instance ID of the dedicated firewall
:param list rules: the rules to be pushed on the firewall as defined by
SoftLayer_Network_Firewall_U... | [
"def",
"edit_dedicated_fwl_rules",
"(",
"self",
",",
"firewall_id",
",",
"rules",
")",
":",
"mask",
"=",
"(",
"'mask[networkVlan[firewallInterfaces'",
"'[firewallContextAccessControlLists]]]'",
")",
"svc",
"=",
"self",
".",
"client",
"[",
"'Network_Vlan_Firewall'",
"]",... | Edit the rules for dedicated firewall.
:param integer firewall_id: the instance ID of the dedicated firewall
:param list rules: the rules to be pushed on the firewall as defined by
SoftLayer_Network_Firewall_Update_Request_Rule | [
"Edit",
"the",
"rules",
"for",
"dedicated",
"firewall",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L252-L279 |
softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.edit_standard_fwl_rules | def edit_standard_fwl_rules(self, firewall_id, rules):
"""Edit the rules for standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:param dict rules: the rules to be pushed on the firewall
"""
rule_svc = self.client['Network_Firewall_Update_Req... | python | def edit_standard_fwl_rules(self, firewall_id, rules):
"""Edit the rules for standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:param dict rules: the rules to be pushed on the firewall
"""
rule_svc = self.client['Network_Firewall_Update_Req... | [
"def",
"edit_standard_fwl_rules",
"(",
"self",
",",
"firewall_id",
",",
"rules",
")",
":",
"rule_svc",
"=",
"self",
".",
"client",
"[",
"'Network_Firewall_Update_Request'",
"]",
"template",
"=",
"{",
"'networkComponentFirewallId'",
":",
"firewall_id",
",",
"'rules'"... | Edit the rules for standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:param dict rules: the rules to be pushed on the firewall | [
"Edit",
"the",
"rules",
"for",
"standard",
"firewall",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L281-L291 |
softlayer/softlayer-python | SoftLayer/auth.py | TokenAuthentication.get_request | def get_request(self, request):
"""Sets token-based auth headers."""
request.headers['authenticate'] = {
'complexType': 'PortalLoginToken',
'userId': self.user_id,
'authToken': self.auth_token,
}
return request | python | def get_request(self, request):
"""Sets token-based auth headers."""
request.headers['authenticate'] = {
'complexType': 'PortalLoginToken',
'userId': self.user_id,
'authToken': self.auth_token,
}
return request | [
"def",
"get_request",
"(",
"self",
",",
"request",
")",
":",
"request",
".",
"headers",
"[",
"'authenticate'",
"]",
"=",
"{",
"'complexType'",
":",
"'PortalLoginToken'",
",",
"'userId'",
":",
"self",
".",
"user_id",
",",
"'authToken'",
":",
"self",
".",
"a... | Sets token-based auth headers. | [
"Sets",
"token",
"-",
"based",
"auth",
"headers",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/auth.py#L50-L57 |
softlayer/softlayer-python | SoftLayer/auth.py | BasicAuthentication.get_request | def get_request(self, request):
"""Sets token-based auth headers."""
request.headers['authenticate'] = {
'username': self.username,
'apiKey': self.api_key,
}
return request | python | def get_request(self, request):
"""Sets token-based auth headers."""
request.headers['authenticate'] = {
'username': self.username,
'apiKey': self.api_key,
}
return request | [
"def",
"get_request",
"(",
"self",
",",
"request",
")",
":",
"request",
".",
"headers",
"[",
"'authenticate'",
"]",
"=",
"{",
"'username'",
":",
"self",
".",
"username",
",",
"'apiKey'",
":",
"self",
".",
"api_key",
",",
"}",
"return",
"request"
] | Sets token-based auth headers. | [
"Sets",
"token",
"-",
"based",
"auth",
"headers",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/auth.py#L74-L80 |
softlayer/softlayer-python | SoftLayer/auth.py | BasicHTTPAuthentication.get_request | def get_request(self, request):
"""Sets token-based auth headers."""
request.transport_user = self.username
request.transport_password = self.api_key
return request | python | def get_request(self, request):
"""Sets token-based auth headers."""
request.transport_user = self.username
request.transport_password = self.api_key
return request | [
"def",
"get_request",
"(",
"self",
",",
"request",
")",
":",
"request",
".",
"transport_user",
"=",
"self",
".",
"username",
"request",
".",
"transport_password",
"=",
"self",
".",
"api_key",
"return",
"request"
] | Sets token-based auth headers. | [
"Sets",
"token",
"-",
"based",
"auth",
"headers",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/auth.py#L97-L101 |
softlayer/softlayer-python | SoftLayer/CLI/image/edit.py | cli | def cli(env, identifier, name, note, tag):
"""Edit details of an image."""
image_mgr = SoftLayer.ImageManager(env.client)
data = {}
if name:
data['name'] = name
if note:
data['note'] = note
if tag:
data['tag'] = tag
image_id = helpers.resolve_id(image_mgr.resolve_ids... | python | def cli(env, identifier, name, note, tag):
"""Edit details of an image."""
image_mgr = SoftLayer.ImageManager(env.client)
data = {}
if name:
data['name'] = name
if note:
data['note'] = note
if tag:
data['tag'] = tag
image_id = helpers.resolve_id(image_mgr.resolve_ids... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"name",
",",
"note",
",",
"tag",
")",
":",
"image_mgr",
"=",
"SoftLayer",
".",
"ImageManager",
"(",
"env",
".",
"client",
")",
"data",
"=",
"{",
"}",
"if",
"name",
":",
"data",
"[",
"'name'",
"]",
... | Edit details of an image. | [
"Edit",
"details",
"of",
"an",
"image",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/edit.py#L18-L31 |
softlayer/softlayer-python | SoftLayer/CLI/ticket/attach.py | cli | def cli(env, identifier, hardware_identifier, virtual_identifier):
"""Attach devices to a ticket."""
ticket_mgr = SoftLayer.TicketManager(env.client)
if hardware_identifier and virtual_identifier:
raise exceptions.ArgumentError("Cannot attach hardware and a virtual server at the same time")
if... | python | def cli(env, identifier, hardware_identifier, virtual_identifier):
"""Attach devices to a ticket."""
ticket_mgr = SoftLayer.TicketManager(env.client)
if hardware_identifier and virtual_identifier:
raise exceptions.ArgumentError("Cannot attach hardware and a virtual server at the same time")
if... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"hardware_identifier",
",",
"virtual_identifier",
")",
":",
"ticket_mgr",
"=",
"SoftLayer",
".",
"TicketManager",
"(",
"env",
".",
"client",
")",
"if",
"hardware_identifier",
"and",
"virtual_identifier",
":",
"ra... | Attach devices to a ticket. | [
"Attach",
"devices",
"to",
"a",
"ticket",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/attach.py#L19-L35 |
softlayer/softlayer-python | SoftLayer/managers/metadata.py | MetadataManager.get | def get(self, name, param=None):
"""Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes
"""
if name not in self.attribs:
raise exceptions.SoftLayerError('Unknown met... | python | def get(self, name, param=None):
"""Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes
"""
if name not in self.attribs:
raise exceptions.SoftLayerError('Unknown met... | [
"def",
"get",
"(",
"self",
",",
"name",
",",
"param",
"=",
"None",
")",
":",
"if",
"name",
"not",
"in",
"self",
".",
"attribs",
":",
"raise",
"exceptions",
".",
"SoftLayerError",
"(",
"'Unknown metadata attribute.'",
")",
"call_details",
"=",
"self",
".",
... | Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes | [
"Retreive",
"a",
"metadata",
"attribute",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/metadata.py#L73-L100 |
softlayer/softlayer-python | SoftLayer/managers/metadata.py | MetadataManager._get_network | def _get_network(self, kind, router=True, vlans=True, vlan_ids=True):
"""Wrapper for getting details about networks.
:param string kind: network kind. Typically 'public' or 'private'
:param boolean router: flag to include router information
:param boolean vlans: flag to incl... | python | def _get_network(self, kind, router=True, vlans=True, vlan_ids=True):
"""Wrapper for getting details about networks.
:param string kind: network kind. Typically 'public' or 'private'
:param boolean router: flag to include router information
:param boolean vlans: flag to incl... | [
"def",
"_get_network",
"(",
"self",
",",
"kind",
",",
"router",
"=",
"True",
",",
"vlans",
"=",
"True",
",",
"vlan_ids",
"=",
"True",
")",
":",
"network",
"=",
"{",
"}",
"macs",
"=",
"self",
".",
"get",
"(",
"'%s_mac'",
"%",
"kind",
")",
"network",... | Wrapper for getting details about networks.
:param string kind: network kind. Typically 'public' or 'private'
:param boolean router: flag to include router information
:param boolean vlans: flag to include vlan information
:param boolean vlan_ids: flag to include vlan_id... | [
"Wrapper",
"for",
"getting",
"details",
"about",
"networks",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/metadata.py#L102-L127 |
softlayer/softlayer-python | SoftLayer/shell/cmd_env.py | cli | def cli(env):
"""Print environment variables."""
filtered_vars = dict([(k, v)
for k, v in env.vars.items()
if not k.startswith('_')])
env.fout(formatting.iter_to_table(filtered_vars)) | python | def cli(env):
"""Print environment variables."""
filtered_vars = dict([(k, v)
for k, v in env.vars.items()
if not k.startswith('_')])
env.fout(formatting.iter_to_table(filtered_vars)) | [
"def",
"cli",
"(",
"env",
")",
":",
"filtered_vars",
"=",
"dict",
"(",
"[",
"(",
"k",
",",
"v",
")",
"for",
"k",
",",
"v",
"in",
"env",
".",
"vars",
".",
"items",
"(",
")",
"if",
"not",
"k",
".",
"startswith",
"(",
"'_'",
")",
"]",
")",
"en... | Print environment variables. | [
"Print",
"environment",
"variables",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/shell/cmd_env.py#L12-L17 |
softlayer/softlayer-python | SoftLayer/CLI/block/snapshot/restore.py | cli | def cli(env, volume_id, snapshot_id):
"""Restore block volume using a given snapshot"""
block_manager = SoftLayer.BlockStorageManager(env.client)
success = block_manager.restore_from_snapshot(volume_id, snapshot_id)
if success:
click.echo('Block volume %s is being restored using snapshot %s'
... | python | def cli(env, volume_id, snapshot_id):
"""Restore block volume using a given snapshot"""
block_manager = SoftLayer.BlockStorageManager(env.client)
success = block_manager.restore_from_snapshot(volume_id, snapshot_id)
if success:
click.echo('Block volume %s is being restored using snapshot %s'
... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"snapshot_id",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"success",
"=",
"block_manager",
".",
"restore_from_snapshot",
"(",
"volume_id",
",",
"snap... | Restore block volume using a given snapshot | [
"Restore",
"block",
"volume",
"using",
"a",
"given",
"snapshot"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/snapshot/restore.py#L15-L22 |
softlayer/softlayer-python | SoftLayer/CLI/ssl/add.py | cli | def cli(env, crt, csr, icc, key, notes):
"""Add and upload SSL certificate details."""
template = {
'intermediateCertificate': '',
'certificateSigningRequest': '',
'notes': notes,
}
template['certificate'] = open(crt).read()
template['privateKey'] = open(key).read()
if c... | python | def cli(env, crt, csr, icc, key, notes):
"""Add and upload SSL certificate details."""
template = {
'intermediateCertificate': '',
'certificateSigningRequest': '',
'notes': notes,
}
template['certificate'] = open(crt).read()
template['privateKey'] = open(key).read()
if c... | [
"def",
"cli",
"(",
"env",
",",
"crt",
",",
"csr",
",",
"icc",
",",
"key",
",",
"notes",
")",
":",
"template",
"=",
"{",
"'intermediateCertificate'",
":",
"''",
",",
"'certificateSigningRequest'",
":",
"''",
",",
"'notes'",
":",
"notes",
",",
"}",
"temp... | Add and upload SSL certificate details. | [
"Add",
"and",
"upload",
"SSL",
"certificate",
"details",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/add.py#L23-L42 |
softlayer/softlayer-python | SoftLayer/CLI/dedicatedhost/detail.py | cli | def cli(env, identifier, price=False, guests=False):
"""Get details for a virtual server."""
dhost = SoftLayer.DedicatedHostManager(env.client)
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
result = dhost.get_host(identifier)
resul... | python | def cli(env, identifier, price=False, guests=False):
"""Get details for a virtual server."""
dhost = SoftLayer.DedicatedHostManager(env.client)
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
result = dhost.get_host(identifier)
resul... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"price",
"=",
"False",
",",
"guests",
"=",
"False",
")",
":",
"dhost",
"=",
"SoftLayer",
".",
"DedicatedHostManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",... | Get details for a virtual server. | [
"Get",
"details",
"for",
"a",
"virtual",
"server",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dedicatedhost/detail.py#L21-L65 |
softlayer/softlayer-python | SoftLayer/CLI/image/export.py | cli | def cli(env, identifier, uri, ibm_api_key):
"""Export an image to object storage.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage
... | python | def cli(env, identifier, uri, ibm_api_key):
"""Export an image to object storage.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage
... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"uri",
",",
"ibm_api_key",
")",
":",
"image_mgr",
"=",
"SoftLayer",
".",
"ImageManager",
"(",
"env",
".",
"client",
")",
"image_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"image_mgr",
".",
"resolve_ids",
... | Export an image to object storage.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage | [
"Export",
"an",
"image",
"to",
"object",
"storage",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/export.py#L22-L36 |
softlayer/softlayer-python | SoftLayer/CLI/account/invoices.py | cli | def cli(env, limit, closed=False, get_all=False):
"""Invoices and all that mess"""
manager = AccountManager(env.client)
invoices = manager.get_invoices(limit, closed, get_all)
table = formatting.Table([
"Id", "Created", "Type", "Status", "Starting Balance", "Ending Balance", "Invoice Amount", ... | python | def cli(env, limit, closed=False, get_all=False):
"""Invoices and all that mess"""
manager = AccountManager(env.client)
invoices = manager.get_invoices(limit, closed, get_all)
table = formatting.Table([
"Id", "Created", "Type", "Status", "Starting Balance", "Ending Balance", "Invoice Amount", ... | [
"def",
"cli",
"(",
"env",
",",
"limit",
",",
"closed",
"=",
"False",
",",
"get_all",
"=",
"False",
")",
":",
"manager",
"=",
"AccountManager",
"(",
"env",
".",
"client",
")",
"invoices",
"=",
"manager",
".",
"get_invoices",
"(",
"limit",
",",
"closed",... | Invoices and all that mess | [
"Invoices",
"and",
"all",
"that",
"mess"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/invoices.py#L20-L46 |
softlayer/softlayer-python | SoftLayer/CLI/virt/__init__.py | MemoryType.convert | def convert(self, value, param, ctx): # pylint: disable=inconsistent-return-statements
"""Validate memory argument. Returns the memory value in megabytes."""
matches = MEMORY_RE.match(value.lower())
if matches is None:
self.fail('%s is not a valid value for memory amount' % value, p... | python | def convert(self, value, param, ctx): # pylint: disable=inconsistent-return-statements
"""Validate memory argument. Returns the memory value in megabytes."""
matches = MEMORY_RE.match(value.lower())
if matches is None:
self.fail('%s is not a valid value for memory amount' % value, p... | [
"def",
"convert",
"(",
"self",
",",
"value",
",",
"param",
",",
"ctx",
")",
":",
"# pylint: disable=inconsistent-return-statements",
"matches",
"=",
"MEMORY_RE",
".",
"match",
"(",
"value",
".",
"lower",
"(",
")",
")",
"if",
"matches",
"is",
"None",
":",
"... | Validate memory argument. Returns the memory value in megabytes. | [
"Validate",
"memory",
"argument",
".",
"Returns",
"the",
"memory",
"value",
"in",
"megabytes",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/__init__.py#L15-L31 |
softlayer/softlayer-python | SoftLayer/CLI/nas/credentials.py | cli | def cli(env, identifier):
"""List NAS account credentials."""
nw_mgr = SoftLayer.NetworkManager(env.client)
result = nw_mgr.get_nas_credentials(identifier)
table = formatting.Table(['username', 'password'])
table.add_row([result.get('username', 'None'),
result.get('password', 'No... | python | def cli(env, identifier):
"""List NAS account credentials."""
nw_mgr = SoftLayer.NetworkManager(env.client)
result = nw_mgr.get_nas_credentials(identifier)
table = formatting.Table(['username', 'password'])
table.add_row([result.get('username', 'None'),
result.get('password', 'No... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"nw_mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"result",
"=",
"nw_mgr",
".",
"get_nas_credentials",
"(",
"identifier",
")",
"table",
"=",
"formatting",
".",
"Table",... | List NAS account credentials. | [
"List",
"NAS",
"account",
"credentials",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/nas/credentials.py#L14-L22 |
softlayer/softlayer-python | SoftLayer/CLI/firewall/detail.py | cli | def cli(env, identifier):
"""Detail firewall."""
mgr = SoftLayer.FirewallManager(env.client)
firewall_type, firewall_id = firewall.parse_id(identifier)
if firewall_type == 'vlan':
rules = mgr.get_dedicated_fwl_rules(firewall_id)
else:
rules = mgr.get_standard_fwl_rules(firewall_id)... | python | def cli(env, identifier):
"""Detail firewall."""
mgr = SoftLayer.FirewallManager(env.client)
firewall_type, firewall_id = firewall.parse_id(identifier)
if firewall_type == 'vlan':
rules = mgr.get_dedicated_fwl_rules(firewall_id)
else:
rules = mgr.get_standard_fwl_rules(firewall_id)... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"FirewallManager",
"(",
"env",
".",
"client",
")",
"firewall_type",
",",
"firewall_id",
"=",
"firewall",
".",
"parse_id",
"(",
"identifier",
")",
"if",
"firewall_type",
"=... | Detail firewall. | [
"Detail",
"firewall",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/detail.py#L16-L27 |
softlayer/softlayer-python | SoftLayer/CLI/firewall/detail.py | get_rules_table | def get_rules_table(rules):
"""Helper to format the rules into a table.
:param list rules: A list containing the rules of the firewall
:returns: a formatted table of the firewall rules
"""
table = formatting.Table(['#', 'action', 'protocol', 'src_ip', 'src_mask',
'dest... | python | def get_rules_table(rules):
"""Helper to format the rules into a table.
:param list rules: A list containing the rules of the firewall
:returns: a formatted table of the firewall rules
"""
table = formatting.Table(['#', 'action', 'protocol', 'src_ip', 'src_mask',
'dest... | [
"def",
"get_rules_table",
"(",
"rules",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'#'",
",",
"'action'",
",",
"'protocol'",
",",
"'src_ip'",
",",
"'src_mask'",
",",
"'dest'",
",",
"'dest_mask'",
"]",
")",
"table",
".",
"sortby",
"=",... | Helper to format the rules into a table.
:param list rules: A list containing the rules of the firewall
:returns: a formatted table of the firewall rules | [
"Helper",
"to",
"format",
"the",
"rules",
"into",
"a",
"table",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/detail.py#L30-L50 |
softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager.add_key | def add_key(self, key, label, notes=None):
"""Adds a new SSH key to the account.
:param string key: The SSH key to add
:param string label: The label for the key
:param string notes: Additional notes for the key
:returns: A dictionary of the new key's information.
"""
... | python | def add_key(self, key, label, notes=None):
"""Adds a new SSH key to the account.
:param string key: The SSH key to add
:param string label: The label for the key
:param string notes: Additional notes for the key
:returns: A dictionary of the new key's information.
"""
... | [
"def",
"add_key",
"(",
"self",
",",
"key",
",",
"label",
",",
"notes",
"=",
"None",
")",
":",
"order",
"=",
"{",
"'key'",
":",
"key",
",",
"'label'",
":",
"label",
",",
"'notes'",
":",
"notes",
",",
"}",
"return",
"self",
".",
"sshkey",
".",
"cre... | Adds a new SSH key to the account.
:param string key: The SSH key to add
:param string label: The label for the key
:param string notes: Additional notes for the key
:returns: A dictionary of the new key's information. | [
"Adds",
"a",
"new",
"SSH",
"key",
"to",
"the",
"account",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L26-L40 |
softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager.edit_key | def edit_key(self, key_id, label=None, notes=None):
"""Edits information about an SSH key.
:param int key_id: The ID of the key to edit
:param string label: The new label for the key
:param string notes: Notes to set or change on the key
:returns: A Boolean indicating success or... | python | def edit_key(self, key_id, label=None, notes=None):
"""Edits information about an SSH key.
:param int key_id: The ID of the key to edit
:param string label: The new label for the key
:param string notes: Notes to set or change on the key
:returns: A Boolean indicating success or... | [
"def",
"edit_key",
"(",
"self",
",",
"key_id",
",",
"label",
"=",
"None",
",",
"notes",
"=",
"None",
")",
":",
"data",
"=",
"{",
"}",
"if",
"label",
":",
"data",
"[",
"'label'",
"]",
"=",
"label",
"if",
"notes",
":",
"data",
"[",
"'notes'",
"]",
... | Edits information about an SSH key.
:param int key_id: The ID of the key to edit
:param string label: The new label for the key
:param string notes: Notes to set or change on the key
:returns: A Boolean indicating success or failure | [
"Edits",
"information",
"about",
"an",
"SSH",
"key",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L50-L66 |
softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager.list_keys | def list_keys(self, label=None):
"""Lists all SSH keys on the account.
:param string label: Filter list based on SSH key label
:returns: A list of dictionaries with information about each key
"""
_filter = utils.NestedDict({})
if label:
_filter['sshKeys']['la... | python | def list_keys(self, label=None):
"""Lists all SSH keys on the account.
:param string label: Filter list based on SSH key label
:returns: A list of dictionaries with information about each key
"""
_filter = utils.NestedDict({})
if label:
_filter['sshKeys']['la... | [
"def",
"list_keys",
"(",
"self",
",",
"label",
"=",
"None",
")",
":",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"{",
"}",
")",
"if",
"label",
":",
"_filter",
"[",
"'sshKeys'",
"]",
"[",
"'label'",
"]",
"=",
"utils",
".",
"query_filter",
"(",
... | Lists all SSH keys on the account.
:param string label: Filter list based on SSH key label
:returns: A list of dictionaries with information about each key | [
"Lists",
"all",
"SSH",
"keys",
"on",
"the",
"account",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L76-L86 |
softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager._get_ids_from_label | def _get_ids_from_label(self, label):
"""Return sshkey IDs which match the given label."""
keys = self.list_keys()
results = []
for key in keys:
if key['label'] == label:
results.append(key['id'])
return results | python | def _get_ids_from_label(self, label):
"""Return sshkey IDs which match the given label."""
keys = self.list_keys()
results = []
for key in keys:
if key['label'] == label:
results.append(key['id'])
return results | [
"def",
"_get_ids_from_label",
"(",
"self",
",",
"label",
")",
":",
"keys",
"=",
"self",
".",
"list_keys",
"(",
")",
"results",
"=",
"[",
"]",
"for",
"key",
"in",
"keys",
":",
"if",
"key",
"[",
"'label'",
"]",
"==",
"label",
":",
"results",
".",
"ap... | Return sshkey IDs which match the given label. | [
"Return",
"sshkey",
"IDs",
"which",
"match",
"the",
"given",
"label",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L88-L95 |
softlayer/softlayer-python | SoftLayer/CLI/ssl/download.py | cli | def cli(env, identifier):
"""Download SSL certificate and key file."""
manager = SoftLayer.SSLManager(env.client)
certificate = manager.get_certificate(identifier)
write_cert(certificate['commonName'] + '.crt', certificate['certificate'])
write_cert(certificate['commonName'] + '.key', certificate[... | python | def cli(env, identifier):
"""Download SSL certificate and key file."""
manager = SoftLayer.SSLManager(env.client)
certificate = manager.get_certificate(identifier)
write_cert(certificate['commonName'] + '.crt', certificate['certificate'])
write_cert(certificate['commonName'] + '.key', certificate[... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"SSLManager",
"(",
"env",
".",
"client",
")",
"certificate",
"=",
"manager",
".",
"get_certificate",
"(",
"identifier",
")",
"write_cert",
"(",
"certificate",
"[",
"'c... | Download SSL certificate and key file. | [
"Download",
"SSL",
"certificate",
"and",
"key",
"file",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/download.py#L13-L28 |
softlayer/softlayer-python | SoftLayer/CLI/virt/capture.py | cli | def cli(env, identifier, name, all, note):
"""Capture one or all disks from a virtual server to a SoftLayer image."""
vsi = SoftLayer.VSManager(env.client)
vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')
capture = vsi.capture(vs_id, name, all, note)
table = formatting.KeyValueTable(... | python | def cli(env, identifier, name, all, note):
"""Capture one or all disks from a virtual server to a SoftLayer image."""
vsi = SoftLayer.VSManager(env.client)
vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')
capture = vsi.capture(vs_id, name, all, note)
table = formatting.KeyValueTable(... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"name",
",",
"all",
",",
"note",
")",
":",
"vsi",
"=",
"SoftLayer",
".",
"VSManager",
"(",
"env",
".",
"client",
")",
"vs_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"vsi",
".",
"resolve_ids",
",",
... | Capture one or all disks from a virtual server to a SoftLayer image. | [
"Capture",
"one",
"or",
"all",
"disks",
"from",
"a",
"virtual",
"server",
"to",
"a",
"SoftLayer",
"image",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capture.py#L20-L38 |
softlayer/softlayer-python | SoftLayer/managers/event_log.py | EventLogManager.get_event_logs | def get_event_logs(self, request_filter=None, log_limit=20, iterator=True):
"""Returns a list of event logs
Example::
event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event... | python | def get_event_logs(self, request_filter=None, log_limit=20, iterator=True):
"""Returns a list of event logs
Example::
event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event... | [
"def",
"get_event_logs",
"(",
"self",
",",
"request_filter",
"=",
"None",
",",
"log_limit",
"=",
"20",
",",
"iterator",
"=",
"True",
")",
":",
"if",
"iterator",
":",
"# Call iter_call directly as this returns the actual generator",
"return",
"self",
".",
"client",
... | Returns a list of event logs
Example::
event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event_mgr.get_event_logs(request_filter)
for log in logs:
print(... | [
"Returns",
"a",
"list",
"of",
"event",
"logs"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/event_log.py#L23-L44 |
softlayer/softlayer-python | SoftLayer/managers/event_log.py | EventLogManager.build_filter | def build_filter(date_min=None, date_max=None, obj_event=None, obj_id=None, obj_type=None, utc_offset=None):
"""Returns a query filter that can be passed into EventLogManager.get_event_logs
:param string date_min: Lower bound date in MM/DD/YYYY format
:param string date_max: Upper bound date in... | python | def build_filter(date_min=None, date_max=None, obj_event=None, obj_id=None, obj_type=None, utc_offset=None):
"""Returns a query filter that can be passed into EventLogManager.get_event_logs
:param string date_min: Lower bound date in MM/DD/YYYY format
:param string date_max: Upper bound date in... | [
"def",
"build_filter",
"(",
"date_min",
"=",
"None",
",",
"date_max",
"=",
"None",
",",
"obj_event",
"=",
"None",
",",
"obj_id",
"=",
"None",
",",
"obj_type",
"=",
"None",
",",
"utc_offset",
"=",
"None",
")",
":",
"if",
"not",
"any",
"(",
"[",
"date_... | Returns a query filter that can be passed into EventLogManager.get_event_logs
:param string date_min: Lower bound date in MM/DD/YYYY format
:param string date_max: Upper bound date in MM/DD/YYYY format
:param string obj_event: The name of the events we want to filter by
:param int obj_i... | [
"Returns",
"a",
"query",
"filter",
"that",
"can",
"be",
"passed",
"into",
"EventLogManager",
".",
"get_event_logs"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/event_log.py#L55-L91 |
softlayer/softlayer-python | SoftLayer/CLI/dns/record_list.py | cli | def cli(env, zone, data, record, ttl, type):
"""List all records in a zone."""
manager = SoftLayer.DNSManager(env.client)
table = formatting.Table(['id', 'record', 'type', 'ttl', 'data'])
table.align['ttl'] = 'l'
table.align['record'] = 'r'
table.align['data'] = 'l'
zone_id = helpers.reso... | python | def cli(env, zone, data, record, ttl, type):
"""List all records in a zone."""
manager = SoftLayer.DNSManager(env.client)
table = formatting.Table(['id', 'record', 'type', 'ttl', 'data'])
table.align['ttl'] = 'l'
table.align['record'] = 'r'
table.align['data'] = 'l'
zone_id = helpers.reso... | [
"def",
"cli",
"(",
"env",
",",
"zone",
",",
"data",
",",
"record",
",",
"ttl",
",",
"type",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"DNSManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
... | List all records in a zone. | [
"List",
"all",
"records",
"in",
"a",
"zone",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/record_list.py#L22-L49 |
softlayer/softlayer-python | SoftLayer/CLI/ticket/subjects.py | cli | def cli(env):
"""List Subject IDs for ticket creation."""
ticket_mgr = SoftLayer.TicketManager(env.client)
table = formatting.Table(['id', 'subject'])
for subject in ticket_mgr.list_subjects():
table.add_row([subject['id'], subject['name']])
env.fout(table) | python | def cli(env):
"""List Subject IDs for ticket creation."""
ticket_mgr = SoftLayer.TicketManager(env.client)
table = formatting.Table(['id', 'subject'])
for subject in ticket_mgr.list_subjects():
table.add_row([subject['id'], subject['name']])
env.fout(table) | [
"def",
"cli",
"(",
"env",
")",
":",
"ticket_mgr",
"=",
"SoftLayer",
".",
"TicketManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'subject'",
"]",
")",
"for",
"subject",
"in",
"ticket_mgr",
".",... | List Subject IDs for ticket creation. | [
"List",
"Subject",
"IDs",
"for",
"ticket",
"creation",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/subjects.py#L13-L21 |
softlayer/softlayer-python | SoftLayer/CLI/virt/placementgroup/create.py | cli | def cli(env, **args):
"""Create a placement group."""
manager = PlacementManager(env.client)
backend_router_id = helpers.resolve_id(manager.get_backend_router_id_from_hostname,
args.get('backend_router'),
'backendRouter')
... | python | def cli(env, **args):
"""Create a placement group."""
manager = PlacementManager(env.client)
backend_router_id = helpers.resolve_id(manager.get_backend_router_id_from_hostname,
args.get('backend_router'),
'backendRouter')
... | [
"def",
"cli",
"(",
"env",
",",
"*",
"*",
"args",
")",
":",
"manager",
"=",
"PlacementManager",
"(",
"env",
".",
"client",
")",
"backend_router_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"manager",
".",
"get_backend_router_id_from_hostname",
",",
"args",
".... | Create a placement group. | [
"Create",
"a",
"placement",
"group",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/placementgroup/create.py#L17-L31 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | cli | def cli(env, identifier, keys, permissions, hardware, virtual, logins, events):
"""User details."""
mgr = SoftLayer.UserManager(env.client)
user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
object_mask = "userStatus[name], parent[id, username], apiAuthenticationKeys[authenticationKe... | python | def cli(env, identifier, keys, permissions, hardware, virtual, logins, events):
"""User details."""
mgr = SoftLayer.UserManager(env.client)
user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
object_mask = "userStatus[name], parent[id, username], apiAuthenticationKeys[authenticationKe... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"keys",
",",
"permissions",
",",
"hardware",
",",
"virtual",
",",
"logins",
",",
"events",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"UserManager",
"(",
"env",
".",
"client",
")",
"user_id",
"=",
"helpers... | User details. | [
"User",
"details",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L28-L56 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | basic_info | def basic_info(user, keys):
"""Prints a table of basic user information"""
table = formatting.KeyValueTable(['Title', 'Basic Information'])
table.align['Title'] = 'r'
table.align['Basic Information'] = 'l'
table.add_row(['Id', user.get('id', '-')])
table.add_row(['Username', user.get('username... | python | def basic_info(user, keys):
"""Prints a table of basic user information"""
table = formatting.KeyValueTable(['Title', 'Basic Information'])
table.align['Title'] = 'r'
table.align['Basic Information'] = 'l'
table.add_row(['Id', user.get('id', '-')])
table.add_row(['Username', user.get('username... | [
"def",
"basic_info",
"(",
"user",
",",
"keys",
")",
":",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",
"[",
"'Title'",
",",
"'Basic Information'",
"]",
")",
"table",
".",
"align",
"[",
"'Title'",
"]",
"=",
"'r'",
"table",
".",
"align",
"[",
"'... | Prints a table of basic user information | [
"Prints",
"a",
"table",
"of",
"basic",
"user",
"information"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L59-L95 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_permissions | def print_permissions(permissions):
"""Prints out a users permissions"""
table = formatting.Table(['keyName', 'Description'])
for perm in permissions:
table.add_row([perm['keyName'], perm['name']])
return table | python | def print_permissions(permissions):
"""Prints out a users permissions"""
table = formatting.Table(['keyName', 'Description'])
for perm in permissions:
table.add_row([perm['keyName'], perm['name']])
return table | [
"def",
"print_permissions",
"(",
"permissions",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'keyName'",
",",
"'Description'",
"]",
")",
"for",
"perm",
"in",
"permissions",
":",
"table",
".",
"add_row",
"(",
"[",
"perm",
"[",
"'keyName'",... | Prints out a users permissions | [
"Prints",
"out",
"a",
"users",
"permissions"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L98-L104 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_access | def print_access(access, title):
"""Prints out the hardware or virtual guests a user can access"""
columns = ['id', 'hostname', 'Primary Public IP', 'Primary Private IP', 'Created']
table = formatting.Table(columns, title)
for host in access:
host_id = host.get('id')
host_fqdn = host.g... | python | def print_access(access, title):
"""Prints out the hardware or virtual guests a user can access"""
columns = ['id', 'hostname', 'Primary Public IP', 'Primary Private IP', 'Created']
table = formatting.Table(columns, title)
for host in access:
host_id = host.get('id')
host_fqdn = host.g... | [
"def",
"print_access",
"(",
"access",
",",
"title",
")",
":",
"columns",
"=",
"[",
"'id'",
",",
"'hostname'",
",",
"'Primary Public IP'",
",",
"'Primary Private IP'",
",",
"'Created'",
"]",
"table",
"=",
"formatting",
".",
"Table",
"(",
"columns",
",",
"titl... | Prints out the hardware or virtual guests a user can access | [
"Prints",
"out",
"the",
"hardware",
"or",
"virtual",
"guests",
"a",
"user",
"can",
"access"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L107-L120 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_dedicated_access | def print_dedicated_access(access):
"""Prints out the dedicated hosts a user can access"""
table = formatting.Table(['id', 'Name', 'Cpus', 'Memory', 'Disk', 'Created'], 'Dedicated Access')
for host in access:
host_id = host.get('id')
host_fqdn = host.get('name')
host_cpu = host.get(... | python | def print_dedicated_access(access):
"""Prints out the dedicated hosts a user can access"""
table = formatting.Table(['id', 'Name', 'Cpus', 'Memory', 'Disk', 'Created'], 'Dedicated Access')
for host in access:
host_id = host.get('id')
host_fqdn = host.get('name')
host_cpu = host.get(... | [
"def",
"print_dedicated_access",
"(",
"access",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'Name'",
",",
"'Cpus'",
",",
"'Memory'",
",",
"'Disk'",
",",
"'Created'",
"]",
",",
"'Dedicated Access'",
")",
"for",
"host",
"in",
... | Prints out the dedicated hosts a user can access | [
"Prints",
"out",
"the",
"dedicated",
"hosts",
"a",
"user",
"can",
"access"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L123-L135 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_logins | def print_logins(logins):
"""Prints out the login history for a user"""
table = formatting.Table(['Date', 'IP Address', 'Successufl Login?'])
for login in logins:
table.add_row([login.get('createDate'), login.get('ipAddress'), login.get('successFlag')])
return table | python | def print_logins(logins):
"""Prints out the login history for a user"""
table = formatting.Table(['Date', 'IP Address', 'Successufl Login?'])
for login in logins:
table.add_row([login.get('createDate'), login.get('ipAddress'), login.get('successFlag')])
return table | [
"def",
"print_logins",
"(",
"logins",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'Date'",
",",
"'IP Address'",
",",
"'Successufl Login?'",
"]",
")",
"for",
"login",
"in",
"logins",
":",
"table",
".",
"add_row",
"(",
"[",
"login",
".",... | Prints out the login history for a user | [
"Prints",
"out",
"the",
"login",
"history",
"for",
"a",
"user"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L138-L143 |
softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_events | def print_events(events):
"""Prints out the event log for a user"""
columns = ['Date', 'Type', 'IP Address', 'label', 'username']
table = formatting.Table(columns)
for event in events:
table.add_row([event.get('eventCreateDate'), event.get('eventName'),
event.get('ipAddres... | python | def print_events(events):
"""Prints out the event log for a user"""
columns = ['Date', 'Type', 'IP Address', 'label', 'username']
table = formatting.Table(columns)
for event in events:
table.add_row([event.get('eventCreateDate'), event.get('eventName'),
event.get('ipAddres... | [
"def",
"print_events",
"(",
"events",
")",
":",
"columns",
"=",
"[",
"'Date'",
",",
"'Type'",
",",
"'IP Address'",
",",
"'label'",
",",
"'username'",
"]",
"table",
"=",
"formatting",
".",
"Table",
"(",
"columns",
")",
"for",
"event",
"in",
"events",
":",... | Prints out the event log for a user | [
"Prints",
"out",
"the",
"event",
"log",
"for",
"a",
"user"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L146-L153 |
softlayer/softlayer-python | SoftLayer/CLI/block/access/list.py | cli | def cli(env, columns, sortby, volume_id):
"""List ACLs."""
block_manager = SoftLayer.BlockStorageManager(env.client)
access_list = block_manager.get_block_volume_access_list(
volume_id=volume_id)
table = formatting.Table(columns.columns)
table.sortby = sortby
for key, type_name in [('al... | python | def cli(env, columns, sortby, volume_id):
"""List ACLs."""
block_manager = SoftLayer.BlockStorageManager(env.client)
access_list = block_manager.get_block_volume_access_list(
volume_id=volume_id)
table = formatting.Table(columns.columns)
table.sortby = sortby
for key, type_name in [('al... | [
"def",
"cli",
"(",
"env",
",",
"columns",
",",
"sortby",
",",
"volume_id",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"access_list",
"=",
"block_manager",
".",
"get_block_volume_access_list",
"(",
"... | List ACLs. | [
"List",
"ACLs",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/access/list.py#L21-L38 |
softlayer/softlayer-python | SoftLayer/CLI/user/delete.py | cli | def cli(env, identifier):
"""Sets a user's status to CANCEL_PENDING, which will immediately disable the account,
and will eventually be fully removed from the account by an automated internal process.
Example: slcli user delete userId
"""
mgr = SoftLayer.UserManager(env.client)
user_id = hel... | python | def cli(env, identifier):
"""Sets a user's status to CANCEL_PENDING, which will immediately disable the account,
and will eventually be fully removed from the account by an automated internal process.
Example: slcli user delete userId
"""
mgr = SoftLayer.UserManager(env.client)
user_id = hel... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"UserManager",
"(",
"env",
".",
"client",
")",
"user_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"identifier",
",",
"'username'",
")",
... | Sets a user's status to CANCEL_PENDING, which will immediately disable the account,
and will eventually be fully removed from the account by an automated internal process.
Example: slcli user delete userId | [
"Sets",
"a",
"user",
"s",
"status",
"to",
"CANCEL_PENDING",
"which",
"will",
"immediately",
"disable",
"the",
"account"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/delete.py#L14-L32 |
softlayer/softlayer-python | SoftLayer/CLI/ssl/edit.py | cli | def cli(env, identifier, crt, csr, icc, key, notes):
"""Edit SSL certificate."""
template = {'id': identifier}
if crt:
template['certificate'] = open(crt).read()
if key:
template['privateKey'] = open(key).read()
if csr:
template['certificateSigningRequest'] = open(csr).read()... | python | def cli(env, identifier, crt, csr, icc, key, notes):
"""Edit SSL certificate."""
template = {'id': identifier}
if crt:
template['certificate'] = open(crt).read()
if key:
template['privateKey'] = open(key).read()
if csr:
template['certificateSigningRequest'] = open(csr).read()... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"crt",
",",
"csr",
",",
"icc",
",",
"key",
",",
"notes",
")",
":",
"template",
"=",
"{",
"'id'",
":",
"identifier",
"}",
"if",
"crt",
":",
"template",
"[",
"'certificate'",
"]",
"=",
"open",
"(",
... | Edit SSL certificate. | [
"Edit",
"SSL",
"certificate",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/edit.py#L24-L39 |
softlayer/softlayer-python | SoftLayer/CLI/cdn/origin_add.py | cli | def cli(env, account_id, content_url, type, cname):
"""Create an origin pull mapping."""
manager = SoftLayer.CDNManager(env.client)
manager.add_origin(account_id, type, content_url, cname) | python | def cli(env, account_id, content_url, type, cname):
"""Create an origin pull mapping."""
manager = SoftLayer.CDNManager(env.client)
manager.add_origin(account_id, type, content_url, cname) | [
"def",
"cli",
"(",
"env",
",",
"account_id",
",",
"content_url",
",",
"type",
",",
"cname",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"CDNManager",
"(",
"env",
".",
"client",
")",
"manager",
".",
"add_origin",
"(",
"account_id",
",",
"type",
",",
"co... | Create an origin pull mapping. | [
"Create",
"an",
"origin",
"pull",
"mapping",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/cdn/origin_add.py#L22-L26 |
softlayer/softlayer-python | SoftLayer/CLI/template.py | export_to_template | def export_to_template(filename, args, exclude=None):
"""Exports given options to the given filename in INI format.
:param filename: Filename to save options to
:param dict args: Arguments to export
:param list exclude (optional): Exclusion list for options that should not
... | python | def export_to_template(filename, args, exclude=None):
"""Exports given options to the given filename in INI format.
:param filename: Filename to save options to
:param dict args: Arguments to export
:param list exclude (optional): Exclusion list for options that should not
... | [
"def",
"export_to_template",
"(",
"filename",
",",
"args",
",",
"exclude",
"=",
"None",
")",
":",
"exclude",
"=",
"exclude",
"or",
"[",
"]",
"exclude",
".",
"append",
"(",
"'config'",
")",
"exclude",
".",
"append",
"(",
"'really'",
")",
"exclude",
".",
... | Exports given options to the given filename in INI format.
:param filename: Filename to save options to
:param dict args: Arguments to export
:param list exclude (optional): Exclusion list for options that should not
be exported | [
"Exports",
"given",
"options",
"to",
"the",
"given",
"filename",
"in",
"INI",
"format",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/template.py#L47-L68 |
softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.list | def list(self, mask=None):
"""List existing placement groups
Calls SoftLayer_Account::getPlacementGroups
"""
if mask is None:
mask = "mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]"
groups = self.client.call('Account', 'getPlacementGroups'... | python | def list(self, mask=None):
"""List existing placement groups
Calls SoftLayer_Account::getPlacementGroups
"""
if mask is None:
mask = "mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]"
groups = self.client.call('Account', 'getPlacementGroups'... | [
"def",
"list",
"(",
"self",
",",
"mask",
"=",
"None",
")",
":",
"if",
"mask",
"is",
"None",
":",
"mask",
"=",
"\"mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]\"",
"groups",
"=",
"self",
".",
"client",
".",
"call",
"(",
"'Account'",
",... | List existing placement groups
Calls SoftLayer_Account::getPlacementGroups | [
"List",
"existing",
"placement",
"groups"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L40-L48 |
softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.get_object | def get_object(self, group_id, mask=None):
"""Returns a PlacementGroup Object
https://softlayer.github.io/reference/services/SoftLayer_Virtual_PlacementGroup/getObject
"""
if mask is None:
mask = "mask[id, name, createDate, rule, backendRouter[id, hostname]," \
... | python | def get_object(self, group_id, mask=None):
"""Returns a PlacementGroup Object
https://softlayer.github.io/reference/services/SoftLayer_Virtual_PlacementGroup/getObject
"""
if mask is None:
mask = "mask[id, name, createDate, rule, backendRouter[id, hostname]," \
... | [
"def",
"get_object",
"(",
"self",
",",
"group_id",
",",
"mask",
"=",
"None",
")",
":",
"if",
"mask",
"is",
"None",
":",
"mask",
"=",
"\"mask[id, name, createDate, rule, backendRouter[id, hostname],\"",
"\"guests[activeTransaction[id,transactionStatus[name,friendlyName]]]]\"",... | Returns a PlacementGroup Object
https://softlayer.github.io/reference/services/SoftLayer_Virtual_PlacementGroup/getObject | [
"Returns",
"a",
"PlacementGroup",
"Object"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L72-L80 |
softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.get_rule_id_from_name | def get_rule_id_from_name(self, name):
"""Finds the rule that matches name.
SoftLayer_Virtual_PlacementGroup_Rule.getAllObjects doesn't support objectFilters.
"""
results = self.client.call('SoftLayer_Virtual_PlacementGroup_Rule', 'getAllObjects')
return [result['id'] for result... | python | def get_rule_id_from_name(self, name):
"""Finds the rule that matches name.
SoftLayer_Virtual_PlacementGroup_Rule.getAllObjects doesn't support objectFilters.
"""
results = self.client.call('SoftLayer_Virtual_PlacementGroup_Rule', 'getAllObjects')
return [result['id'] for result... | [
"def",
"get_rule_id_from_name",
"(",
"self",
",",
"name",
")",
":",
"results",
"=",
"self",
".",
"client",
".",
"call",
"(",
"'SoftLayer_Virtual_PlacementGroup_Rule'",
",",
"'getAllObjects'",
")",
"return",
"[",
"result",
"[",
"'id'",
"]",
"for",
"result",
"in... | Finds the rule that matches name.
SoftLayer_Virtual_PlacementGroup_Rule.getAllObjects doesn't support objectFilters. | [
"Finds",
"the",
"rule",
"that",
"matches",
"name",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L94-L100 |
softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.get_backend_router_id_from_hostname | def get_backend_router_id_from_hostname(self, hostname):
"""Finds the backend router Id that matches the hostname given
No way to use an objectFilter to find a backendRouter, so we have to search the hard way.
"""
results = self.client.call('SoftLayer_Network_Pod', 'getAllObjects')
... | python | def get_backend_router_id_from_hostname(self, hostname):
"""Finds the backend router Id that matches the hostname given
No way to use an objectFilter to find a backendRouter, so we have to search the hard way.
"""
results = self.client.call('SoftLayer_Network_Pod', 'getAllObjects')
... | [
"def",
"get_backend_router_id_from_hostname",
"(",
"self",
",",
"hostname",
")",
":",
"results",
"=",
"self",
".",
"client",
".",
"call",
"(",
"'SoftLayer_Network_Pod'",
",",
"'getAllObjects'",
")",
"return",
"[",
"result",
"[",
"'backendRouterId'",
"]",
"for",
... | Finds the backend router Id that matches the hostname given
No way to use an objectFilter to find a backendRouter, so we have to search the hard way. | [
"Finds",
"the",
"backend",
"router",
"Id",
"that",
"matches",
"the",
"hostname",
"given"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L102-L108 |
softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager._get_id_from_name | def _get_id_from_name(self, name):
"""List placement group ids which match the given name."""
_filter = {
'placementGroups': {
'name': {'operation': name}
}
}
mask = "mask[id, name]"
results = self.client.call('Account', 'getPlacementGroups... | python | def _get_id_from_name(self, name):
"""List placement group ids which match the given name."""
_filter = {
'placementGroups': {
'name': {'operation': name}
}
}
mask = "mask[id, name]"
results = self.client.call('Account', 'getPlacementGroups... | [
"def",
"_get_id_from_name",
"(",
"self",
",",
"name",
")",
":",
"_filter",
"=",
"{",
"'placementGroups'",
":",
"{",
"'name'",
":",
"{",
"'operation'",
":",
"name",
"}",
"}",
"}",
"mask",
"=",
"\"mask[id, name]\"",
"results",
"=",
"self",
".",
"client",
"... | List placement group ids which match the given name. | [
"List",
"placement",
"group",
"ids",
"which",
"match",
"the",
"given",
"name",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L110-L119 |
softlayer/softlayer-python | SoftLayer/CLI/virt/capacity/create_options.py | cli | def cli(env):
"""List options for creating Reserved Capacity"""
manager = CapacityManager(env.client)
items = manager.get_create_options()
items.sort(key=lambda term: int(term['capacity']))
table = formatting.Table(["KeyName", "Description", "Term", "Default Hourly Price Per Instance"],
... | python | def cli(env):
"""List options for creating Reserved Capacity"""
manager = CapacityManager(env.client)
items = manager.get_create_options()
items.sort(key=lambda term: int(term['capacity']))
table = formatting.Table(["KeyName", "Description", "Term", "Default Hourly Price Per Instance"],
... | [
"def",
"cli",
"(",
"env",
")",
":",
"manager",
"=",
"CapacityManager",
"(",
"env",
".",
"client",
")",
"items",
"=",
"manager",
".",
"get_create_options",
"(",
")",
"items",
".",
"sort",
"(",
"key",
"=",
"lambda",
"term",
":",
"int",
"(",
"term",
"["... | List options for creating Reserved Capacity | [
"List",
"options",
"for",
"creating",
"Reserved",
"Capacity"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_options.py#L13-L36 |
softlayer/softlayer-python | SoftLayer/CLI/virt/capacity/create_options.py | get_price | def get_price(item):
"""Finds the price with the default locationGroupId"""
the_price = "No Default Pricing"
for price in item.get('prices', []):
if not price.get('locationGroupId'):
the_price = "%0.4f" % float(price['hourlyRecurringFee'])
return the_price | python | def get_price(item):
"""Finds the price with the default locationGroupId"""
the_price = "No Default Pricing"
for price in item.get('prices', []):
if not price.get('locationGroupId'):
the_price = "%0.4f" % float(price['hourlyRecurringFee'])
return the_price | [
"def",
"get_price",
"(",
"item",
")",
":",
"the_price",
"=",
"\"No Default Pricing\"",
"for",
"price",
"in",
"item",
".",
"get",
"(",
"'prices'",
",",
"[",
"]",
")",
":",
"if",
"not",
"price",
".",
"get",
"(",
"'locationGroupId'",
")",
":",
"the_price",
... | Finds the price with the default locationGroupId | [
"Finds",
"the",
"price",
"with",
"the",
"default",
"locationGroupId"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_options.py#L39-L45 |
softlayer/softlayer-python | SoftLayer/CLI/order/package_list.py | cli | def cli(env, keyword, package_type):
"""List packages that can be ordered via the placeOrder API.
::
# List out all packages for ordering
slcli order package-list
# List out all packages with "server" in the name
slcli order package-list --keyword server
# Select onl... | python | def cli(env, keyword, package_type):
"""List packages that can be ordered via the placeOrder API.
::
# List out all packages for ordering
slcli order package-list
# List out all packages with "server" in the name
slcli order package-list --keyword server
# Select onl... | [
"def",
"cli",
"(",
"env",
",",
"keyword",
",",
"package_type",
")",
":",
"manager",
"=",
"ordering",
".",
"OrderingManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"COLUMNS",
")",
"_filter",
"=",
"{",
"'type'",
"... | List packages that can be ordered via the placeOrder API.
::
# List out all packages for ordering
slcli order package-list
# List out all packages with "server" in the name
slcli order package-list --keyword server
# Select only specifict package types
slcli orde... | [
"List",
"packages",
"that",
"can",
"be",
"ordered",
"via",
"the",
"placeOrder",
"API",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/order/package_list.py#L20-L53 |
softlayer/softlayer-python | SoftLayer/CLI/hardware/create.py | cli | def cli(env, **args):
"""Order/create a dedicated server."""
mgr = SoftLayer.HardwareManager(env.client)
# Get the SSH keys
ssh_keys = []
for key in args.get('key'):
resolver = SoftLayer.SshKeyManager(env.client).resolve_ids
key_id = helpers.resolve_id(resolver, key, 'SshKey')
... | python | def cli(env, **args):
"""Order/create a dedicated server."""
mgr = SoftLayer.HardwareManager(env.client)
# Get the SSH keys
ssh_keys = []
for key in args.get('key'):
resolver = SoftLayer.SshKeyManager(env.client).resolve_ids
key_id = helpers.resolve_id(resolver, key, 'SshKey')
... | [
"def",
"cli",
"(",
"env",
",",
"*",
"*",
"args",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"HardwareManager",
"(",
"env",
".",
"client",
")",
"# Get the SSH keys",
"ssh_keys",
"=",
"[",
"]",
"for",
"key",
"in",
"args",
".",
"get",
"(",
"'key'",
")",
... | Order/create a dedicated server. | [
"Order",
"/",
"create",
"a",
"dedicated",
"server",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/create.py#L66-L139 |
softlayer/softlayer-python | SoftLayer/CLI/loadbal/list.py | cli | def cli(env):
"""List active load balancers."""
mgr = SoftLayer.LoadBalancerManager(env.client)
load_balancers = mgr.get_local_lbs()
table = formatting.Table(['ID',
'VIP Address',
'Location',
'SSL Offload',
... | python | def cli(env):
"""List active load balancers."""
mgr = SoftLayer.LoadBalancerManager(env.client)
load_balancers = mgr.get_local_lbs()
table = formatting.Table(['ID',
'VIP Address',
'Location',
'SSL Offload',
... | [
"def",
"cli",
"(",
"env",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"LoadBalancerManager",
"(",
"env",
".",
"client",
")",
"load_balancers",
"=",
"mgr",
".",
"get_local_lbs",
"(",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'ID'",
",",
"'VI... | List active load balancers. | [
"List",
"active",
"load",
"balancers",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/list.py#L13-L49 |
softlayer/softlayer-python | SoftLayer/CLI/hardware/credentials.py | cli | def cli(env, identifier):
"""List server credentials."""
manager = SoftLayer.HardwareManager(env.client)
hardware_id = helpers.resolve_id(manager.resolve_ids,
identifier,
'hardware')
instance = manager.get_hardware(hardware_id)
... | python | def cli(env, identifier):
"""List server credentials."""
manager = SoftLayer.HardwareManager(env.client)
hardware_id = helpers.resolve_id(manager.resolve_ids,
identifier,
'hardware')
instance = manager.get_hardware(hardware_id)
... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"HardwareManager",
"(",
"env",
".",
"client",
")",
"hardware_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"manager",
".",
"resolve_ids",
",",
"identifier",
",",
"'hard... | List server credentials. | [
"List",
"server",
"credentials",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/credentials.py#L16-L31 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | populate_host_templates | def populate_host_templates(host_templates,
hardware_ids=None,
virtual_guest_ids=None,
ip_address_ids=None,
subnet_ids=None):
"""Populate the given host_templates array with the IDs provided
:param h... | python | def populate_host_templates(host_templates,
hardware_ids=None,
virtual_guest_ids=None,
ip_address_ids=None,
subnet_ids=None):
"""Populate the given host_templates array with the IDs provided
:param h... | [
"def",
"populate_host_templates",
"(",
"host_templates",
",",
"hardware_ids",
"=",
"None",
",",
"virtual_guest_ids",
"=",
"None",
",",
"ip_address_ids",
"=",
"None",
",",
"subnet_ids",
"=",
"None",
")",
":",
"if",
"hardware_ids",
"is",
"not",
"None",
":",
"for... | Populate the given host_templates array with the IDs provided
:param host_templates: The array to which host templates will be added
:param hardware_ids: A List of SoftLayer_Hardware ids
:param virtual_guest_ids: A List of SoftLayer_Virtual_Guest ids
:param ip_address_ids: A List of SoftLayer_Network_S... | [
"Populate",
"the",
"given",
"host_templates",
"array",
"with",
"the",
"IDs",
"provided"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L22-L61 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | get_package | def get_package(manager, category_code):
"""Returns a product package based on type of storage.
:param manager: The storage manager which calls this function.
:param category_code: Category code of product package.
:return: Returns a packaged based on type of storage.
"""
_filter = utils.Neste... | python | def get_package(manager, category_code):
"""Returns a product package based on type of storage.
:param manager: The storage manager which calls this function.
:param category_code: Category code of product package.
:return: Returns a packaged based on type of storage.
"""
_filter = utils.Neste... | [
"def",
"get_package",
"(",
"manager",
",",
"category_code",
")",
":",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"{",
"}",
")",
"_filter",
"[",
"'categories'",
"]",
"[",
"'categoryCode'",
"]",
"=",
"(",
"utils",
".",
"query_filter",
"(",
"category_co... | Returns a product package based on type of storage.
:param manager: The storage manager which calls this function.
:param category_code: Category code of product package.
:return: Returns a packaged based on type of storage. | [
"Returns",
"a",
"product",
"package",
"based",
"on",
"type",
"of",
"storage",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L64-L88 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | get_location_id | def get_location_id(manager, location):
"""Returns location id
:param manager: The storage manager which calls this function.
:param location: Datacenter short name
:return: Returns location id
"""
loc_svc = manager.client['Location_Datacenter']
datacenters = loc_svc.getDatacenters(mask='ma... | python | def get_location_id(manager, location):
"""Returns location id
:param manager: The storage manager which calls this function.
:param location: Datacenter short name
:return: Returns location id
"""
loc_svc = manager.client['Location_Datacenter']
datacenters = loc_svc.getDatacenters(mask='ma... | [
"def",
"get_location_id",
"(",
"manager",
",",
"location",
")",
":",
"loc_svc",
"=",
"manager",
".",
"client",
"[",
"'Location_Datacenter'",
"]",
"datacenters",
"=",
"loc_svc",
".",
"getDatacenters",
"(",
"mask",
"=",
"'mask[longName,id,name]'",
")",
"for",
"dat... | Returns location id
:param manager: The storage manager which calls this function.
:param location: Datacenter short name
:return: Returns location id | [
"Returns",
"location",
"id"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L91-L104 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_price_by_category | def find_price_by_category(package, price_category):
"""Find the price in the given package that has the specified category
:param package: The AsAService, Enterprise, or Performance product package
:param price_category: The price category code to search for
:return: Returns the price for the given ca... | python | def find_price_by_category(package, price_category):
"""Find the price in the given package that has the specified category
:param package: The AsAService, Enterprise, or Performance product package
:param price_category: The price category code to search for
:return: Returns the price for the given ca... | [
"def",
"find_price_by_category",
"(",
"package",
",",
"price_category",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"price_id",
"=",
"_find_price_id",
"(",
"item",
"[",
"'prices'",
"]",
",",
"price_category",
")",
"if",
"price_id",
":... | Find the price in the given package that has the specified category
:param package: The AsAService, Enterprise, or Performance product package
:param price_category: The price category code to search for
:return: Returns the price for the given category, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"that",
"has",
"the",
"specified",
"category"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L107-L119 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_ent_space_price | def find_ent_space_price(package, category, size, tier_level):
"""Find the space price for the given category, size, and tier
:param package: The Enterprise (Endurance) product package
:param category: The category of space (endurance, replication, snapshot)
:param size: The size for which a price is d... | python | def find_ent_space_price(package, category, size, tier_level):
"""Find the space price for the given category, size, and tier
:param package: The Enterprise (Endurance) product package
:param category: The category of space (endurance, replication, snapshot)
:param size: The size for which a price is d... | [
"def",
"find_ent_space_price",
"(",
"package",
",",
"category",
",",
"size",
",",
"tier_level",
")",
":",
"if",
"category",
"==",
"'snapshot'",
":",
"category_code",
"=",
"'storage_snapshot_space'",
"elif",
"category",
"==",
"'replication'",
":",
"category_code",
... | Find the space price for the given category, size, and tier
:param package: The Enterprise (Endurance) product package
:param category: The category of space (endurance, replication, snapshot)
:param size: The size for which a price is desired
:param tier_level: The endurance tier for which a price is ... | [
"Find",
"the",
"space",
"price",
"for",
"the",
"given",
"category",
"size",
"and",
"tier"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L122-L147 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_ent_endurance_tier_price | def find_ent_endurance_tier_price(package, tier_level):
"""Find the price in the given package with the specified tier level
:param package: The Enterprise (Endurance) product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an... | python | def find_ent_endurance_tier_price(package, tier_level):
"""Find the price in the given package with the specified tier level
:param package: The Enterprise (Endurance) product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an... | [
"def",
"find_ent_endurance_tier_price",
"(",
"package",
",",
"tier_level",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"for",
"attribute",
"in",
"item",
".",
"get",
"(",
"'attributes'",
",",
"[",
"]",
")",
":",
"if",
"int",
"(",
... | Find the price in the given package with the specified tier level
:param package: The Enterprise (Endurance) product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"with",
"the",
"specified",
"tier",
"level"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L150-L168 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_endurance_tier_iops_per_gb | def find_endurance_tier_iops_per_gb(volume):
"""Find the tier for the given endurance volume (IOPS per GB)
:param volume: The volume for which the tier level is desired
:return: Returns a float value indicating the IOPS per GB for the volume
"""
tier = volume['storageTierLevel']
iops_per_gb = 0... | python | def find_endurance_tier_iops_per_gb(volume):
"""Find the tier for the given endurance volume (IOPS per GB)
:param volume: The volume for which the tier level is desired
:return: Returns a float value indicating the IOPS per GB for the volume
"""
tier = volume['storageTierLevel']
iops_per_gb = 0... | [
"def",
"find_endurance_tier_iops_per_gb",
"(",
"volume",
")",
":",
"tier",
"=",
"volume",
"[",
"'storageTierLevel'",
"]",
"iops_per_gb",
"=",
"0.25",
"if",
"tier",
"==",
"\"LOW_INTENSITY_TIER\"",
":",
"iops_per_gb",
"=",
"0.25",
"elif",
"tier",
"==",
"\"READHEAVY_... | Find the tier for the given endurance volume (IOPS per GB)
:param volume: The volume for which the tier level is desired
:return: Returns a float value indicating the IOPS per GB for the volume | [
"Find",
"the",
"tier",
"for",
"the",
"given",
"endurance",
"volume",
"(",
"IOPS",
"per",
"GB",
")"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L171-L191 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_perf_space_price | def find_perf_space_price(package, size):
"""Find the price in the given package with the specified size
:param package: The Performance product package
:param size: The storage space size for which a price is desired
:return: Returns the price for the given size, or an error if not found
"""
f... | python | def find_perf_space_price(package, size):
"""Find the price in the given package with the specified size
:param package: The Performance product package
:param size: The storage space size for which a price is desired
:return: Returns the price for the given size, or an error if not found
"""
f... | [
"def",
"find_perf_space_price",
"(",
"package",
",",
"size",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"int",
"(",
"item",
"[",
"'capacity'",
"]",
")",
"!=",
"size",
":",
"continue",
"price_id",
"=",
"_find_price_id",
"(",... | Find the price in the given package with the specified size
:param package: The Performance product package
:param size: The storage space size for which a price is desired
:return: Returns the price for the given size, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"with",
"the",
"specified",
"size"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L194-L209 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_perf_iops_price | def find_perf_iops_price(package, size, iops):
"""Find the price in the given package with the specified size and iops
:param package: The Performance product package
:param size: The size of storage space for which an IOPS price is desired
:param iops: The number of IOPS for which a price is desired
... | python | def find_perf_iops_price(package, size, iops):
"""Find the price in the given package with the specified size and iops
:param package: The Performance product package
:param size: The size of storage space for which an IOPS price is desired
:param iops: The number of IOPS for which a price is desired
... | [
"def",
"find_perf_iops_price",
"(",
"package",
",",
"size",
",",
"iops",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"int",
"(",
"item",
"[",
"'capacity'",
"]",
")",
"!=",
"int",
"(",
"iops",
")",
":",
"continue",
"price... | Find the price in the given package with the specified size and iops
:param package: The Performance product package
:param size: The size of storage space for which an IOPS price is desired
:param iops: The number of IOPS for which a price is desired
:return: Returns the price for the size and IOPS, o... | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"with",
"the",
"specified",
"size",
"and",
"iops"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L212-L228 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_endurance_space_price | def find_saas_endurance_space_price(package, size, tier_level):
"""Find the SaaS endurance storage space price for the size and tier
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param tier_level: The endurance tier for which a price... | python | def find_saas_endurance_space_price(package, size, tier_level):
"""Find the SaaS endurance storage space price for the size and tier
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param tier_level: The endurance tier for which a price... | [
"def",
"find_saas_endurance_space_price",
"(",
"package",
",",
"size",
",",
"tier_level",
")",
":",
"if",
"tier_level",
"!=",
"0.25",
":",
"tier_level",
"=",
"int",
"(",
"tier_level",
")",
"key_name",
"=",
"'STORAGE_SPACE_FOR_{0}_IOPS_PER_GB'",
".",
"format",
"(",... | Find the SaaS endurance storage space price for the size and tier
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the size and tier, or an... | [
"Find",
"the",
"SaaS",
"endurance",
"storage",
"space",
"price",
"for",
"the",
"size",
"and",
"tier"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L231-L259 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_endurance_tier_price | def find_saas_endurance_tier_price(package, tier_level):
"""Find the SaaS storage tier level price for the specified tier level
:param package: The Storage As A Service product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or a... | python | def find_saas_endurance_tier_price(package, tier_level):
"""Find the SaaS storage tier level price for the specified tier level
:param package: The Storage As A Service product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or a... | [
"def",
"find_saas_endurance_tier_price",
"(",
"package",
",",
"tier_level",
")",
":",
"target_capacity",
"=",
"ENDURANCE_TIERS",
".",
"get",
"(",
"tier_level",
")",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"'itemCategory'",
"not",
"in",
... | Find the SaaS storage tier level price for the specified tier level
:param package: The Storage As A Service product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an error if not found | [
"Find",
"the",
"SaaS",
"storage",
"tier",
"level",
"price",
"for",
"the",
"specified",
"tier",
"level"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L262-L284 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_perform_space_price | def find_saas_perform_space_price(package, size):
"""Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not f... | python | def find_saas_perform_space_price(package, size):
"""Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not f... | [
"def",
"find_saas_perform_space_price",
"(",
"package",
",",
"size",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"'itemCategory'",
"not",
"in",
"item",
"or",
"'categoryCode'",
"not",
"in",
"item",
"[",
"'itemCategory'",
"]",
"or... | Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not found | [
"Find",
"the",
"SaaS",
"performance",
"storage",
"space",
"price",
"for",
"the",
"given",
"size"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L287-L316 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_perform_iops_price | def find_saas_perform_iops_price(package, size, iops):
"""Find the SaaS IOPS price for the specified size and iops
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param iops: The number of IOPS for which a price is desired
:return:... | python | def find_saas_perform_iops_price(package, size, iops):
"""Find the SaaS IOPS price for the specified size and iops
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param iops: The number of IOPS for which a price is desired
:return:... | [
"def",
"find_saas_perform_iops_price",
"(",
"package",
",",
"size",
",",
"iops",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"'itemCategory'",
"not",
"in",
"item",
"or",
"'categoryCode'",
"not",
"in",
"item",
"[",
"'itemCategory... | Find the SaaS IOPS price for the specified size and iops
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param iops: The number of IOPS for which a price is desired
:return: Returns the price for the size and IOPS, or an error if not f... | [
"Find",
"the",
"SaaS",
"IOPS",
"price",
"for",
"the",
"specified",
"size",
"and",
"iops"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L319-L346 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_snapshot_space_price | def find_saas_snapshot_space_price(package, size, tier=None, iops=None):
"""Find the price in the SaaS package for the desired snapshot space size
:param package: The product package of the endurance storage type
:param size: The snapshot space size for which a price is desired
:param tier: The tier of... | python | def find_saas_snapshot_space_price(package, size, tier=None, iops=None):
"""Find the price in the SaaS package for the desired snapshot space size
:param package: The product package of the endurance storage type
:param size: The snapshot space size for which a price is desired
:param tier: The tier of... | [
"def",
"find_saas_snapshot_space_price",
"(",
"package",
",",
"size",
",",
"tier",
"=",
"None",
",",
"iops",
"=",
"None",
")",
":",
"if",
"tier",
"is",
"not",
"None",
":",
"target_value",
"=",
"ENDURANCE_TIERS",
".",
"get",
"(",
"tier",
")",
"target_restri... | Find the price in the SaaS package for the desired snapshot space size
:param package: The product package of the endurance storage type
:param size: The snapshot space size for which a price is desired
:param tier: The tier of the volume for which space is being ordered
:param iops: The IOPS of the vo... | [
"Find",
"the",
"price",
"in",
"the",
"SaaS",
"package",
"for",
"the",
"desired",
"snapshot",
"space",
"size"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L349-L373 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_replication_price | def find_saas_replication_price(package, tier=None, iops=None):
"""Find the price in the given package for the desired replicant volume
:param package: The product package of the endurance storage type
:param tier: The tier of the primary storage volume
:param iops: The IOPS of the primary storage volu... | python | def find_saas_replication_price(package, tier=None, iops=None):
"""Find the price in the given package for the desired replicant volume
:param package: The product package of the endurance storage type
:param tier: The tier of the primary storage volume
:param iops: The IOPS of the primary storage volu... | [
"def",
"find_saas_replication_price",
"(",
"package",
",",
"tier",
"=",
"None",
",",
"iops",
"=",
"None",
")",
":",
"if",
"tier",
"is",
"not",
"None",
":",
"target_value",
"=",
"ENDURANCE_TIERS",
".",
"get",
"(",
"tier",
")",
"target_item_keyname",
"=",
"'... | Find the price in the given package for the desired replicant volume
:param package: The product package of the endurance storage type
:param tier: The tier of the primary storage volume
:param iops: The IOPS of the primary storage volume
:return: Returns the replication price, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"for",
"the",
"desired",
"replicant",
"volume"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L376-L406 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_snapshot_schedule_id | def find_snapshot_schedule_id(volume, snapshot_schedule_keyname):
"""Find the snapshot schedule ID for the given volume and keyname
:param volume: The volume for which the snapshot ID is desired
:param snapshot_schedule_keyname: The keyname of the snapshot schedule
:return: Returns an int value indicat... | python | def find_snapshot_schedule_id(volume, snapshot_schedule_keyname):
"""Find the snapshot schedule ID for the given volume and keyname
:param volume: The volume for which the snapshot ID is desired
:param snapshot_schedule_keyname: The keyname of the snapshot schedule
:return: Returns an int value indicat... | [
"def",
"find_snapshot_schedule_id",
"(",
"volume",
",",
"snapshot_schedule_keyname",
")",
":",
"for",
"schedule",
"in",
"volume",
"[",
"'schedules'",
"]",
":",
"if",
"'type'",
"in",
"schedule",
"and",
"'keyname'",
"in",
"schedule",
"[",
"'type'",
"]",
":",
"if... | Find the snapshot schedule ID for the given volume and keyname
:param volume: The volume for which the snapshot ID is desired
:param snapshot_schedule_keyname: The keyname of the snapshot schedule
:return: Returns an int value indicating the volume's snapshot schedule ID | [
"Find",
"the",
"snapshot",
"schedule",
"ID",
"for",
"the",
"given",
"volume",
"and",
"keyname"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L409-L422 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | prepare_snapshot_order_object | def prepare_snapshot_order_object(manager, volume, capacity, tier, upgrade):
"""Prepare the snapshot space order object for the placeOrder() method
:param manager: The File or Block manager calling this function
:param integer volume: The volume for which snapshot space is ordered
:param integer capaci... | python | def prepare_snapshot_order_object(manager, volume, capacity, tier, upgrade):
"""Prepare the snapshot space order object for the placeOrder() method
:param manager: The File or Block manager calling this function
:param integer volume: The volume for which snapshot space is ordered
:param integer capaci... | [
"def",
"prepare_snapshot_order_object",
"(",
"manager",
",",
"volume",
",",
"capacity",
",",
"tier",
",",
"upgrade",
")",
":",
"# Ensure the storage volume has not been cancelled",
"if",
"'billingItem'",
"not",
"in",
"volume",
":",
"raise",
"exceptions",
".",
"SoftLay... | Prepare the snapshot space order object for the placeOrder() method
:param manager: The File or Block manager calling this function
:param integer volume: The volume for which snapshot space is ordered
:param integer capacity: The snapshot space size to order, in GB
:param float tier: The tier level of... | [
"Prepare",
"the",
"snapshot",
"space",
"order",
"object",
"for",
"the",
"placeOrder",
"()",
"method"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L425-L506 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | prepare_volume_order_object | def prepare_volume_order_object(manager, storage_type, location, size,
iops, tier, snapshot_size, service_offering,
volume_type, hourly_billing_flag=False):
"""Prepare the order object which is submitted to the placeOrder() method
:param manager: ... | python | def prepare_volume_order_object(manager, storage_type, location, size,
iops, tier, snapshot_size, service_offering,
volume_type, hourly_billing_flag=False):
"""Prepare the order object which is submitted to the placeOrder() method
:param manager: ... | [
"def",
"prepare_volume_order_object",
"(",
"manager",
",",
"storage_type",
",",
"location",
",",
"size",
",",
"iops",
",",
"tier",
",",
"snapshot_size",
",",
"service_offering",
",",
"volume_type",
",",
"hourly_billing_flag",
"=",
"False",
")",
":",
"# Ensure the ... | Prepare the order object which is submitted to the placeOrder() method
:param manager: The File or Block manager calling this function
:param storage_type: "performance" or "endurance"
:param location: Requested datacenter location name for the ordered volume
:param size: Desired size of the volume, in... | [
"Prepare",
"the",
"order",
"object",
"which",
"is",
"submitted",
"to",
"the",
"placeOrder",
"()",
"method"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L509-L613 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | prepare_replicant_order_object | def prepare_replicant_order_object(manager, snapshot_schedule, location,
tier, volume, volume_type):
"""Prepare the order object which is submitted to the placeOrder() method
:param manager: The File or Block manager calling this function
:param snapshot_schedule: The pri... | python | def prepare_replicant_order_object(manager, snapshot_schedule, location,
tier, volume, volume_type):
"""Prepare the order object which is submitted to the placeOrder() method
:param manager: The File or Block manager calling this function
:param snapshot_schedule: The pri... | [
"def",
"prepare_replicant_order_object",
"(",
"manager",
",",
"snapshot_schedule",
",",
"location",
",",
"tier",
",",
"volume",
",",
"volume_type",
")",
":",
"# Ensure the primary volume and snapshot space are not set for cancellation",
"if",
"'billingItem'",
"not",
"in",
"... | Prepare the order object which is submitted to the placeOrder() method
:param manager: The File or Block manager calling this function
:param snapshot_schedule: The primary volume's snapshot
schedule to use for replication
:param location: The location for the ordered replican... | [
"Prepare",
"the",
"order",
"object",
"which",
"is",
"submitted",
"to",
"the",
"placeOrder",
"()",
"method"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L647-L786 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | prepare_duplicate_order_object | def prepare_duplicate_order_object(manager, origin_volume, iops, tier,
duplicate_size, duplicate_snapshot_size,
volume_type, hourly_billing_flag=False):
"""Prepare the duplicate order to submit to SoftLayer_Product::placeOrder()
:param manag... | python | def prepare_duplicate_order_object(manager, origin_volume, iops, tier,
duplicate_size, duplicate_snapshot_size,
volume_type, hourly_billing_flag=False):
"""Prepare the duplicate order to submit to SoftLayer_Product::placeOrder()
:param manag... | [
"def",
"prepare_duplicate_order_object",
"(",
"manager",
",",
"origin_volume",
",",
"iops",
",",
"tier",
",",
"duplicate_size",
",",
"duplicate_snapshot_size",
",",
"volume_type",
",",
"hourly_billing_flag",
"=",
"False",
")",
":",
"# Verify that the origin volume has not... | Prepare the duplicate order to submit to SoftLayer_Product::placeOrder()
:param manager: The File or Block manager calling this function
:param origin_volume: The origin volume which is being duplicated
:param iops: The IOPS for the duplicate volume (performance)
:param tier: The tier level for the dup... | [
"Prepare",
"the",
"duplicate",
"order",
"to",
"submit",
"to",
"SoftLayer_Product",
"::",
"placeOrder",
"()"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L789-L906 |
softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | prepare_modify_order_object | def prepare_modify_order_object(manager, volume, new_iops, new_tier, new_size):
"""Prepare the modification order to submit to SoftLayer_Product::placeOrder()
:param manager: The File or Block manager calling this function
:param volume: The volume which is being modified
:param new_iops: The new IOPS ... | python | def prepare_modify_order_object(manager, volume, new_iops, new_tier, new_size):
"""Prepare the modification order to submit to SoftLayer_Product::placeOrder()
:param manager: The File or Block manager calling this function
:param volume: The volume which is being modified
:param new_iops: The new IOPS ... | [
"def",
"prepare_modify_order_object",
"(",
"manager",
",",
"volume",
",",
"new_iops",
",",
"new_tier",
",",
"new_size",
")",
":",
"# Verify that the origin volume has not been cancelled",
"if",
"'billingItem'",
"not",
"in",
"volume",
":",
"raise",
"exceptions",
".",
"... | Prepare the modification order to submit to SoftLayer_Product::placeOrder()
:param manager: The File or Block manager calling this function
:param volume: The volume which is being modified
:param new_iops: The new IOPS for the volume (performance)
:param new_tier: The new tier level for the volume (en... | [
"Prepare",
"the",
"modification",
"order",
"to",
"submit",
"to",
"SoftLayer_Product",
"::",
"placeOrder",
"()"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L909-L985 |
softlayer/softlayer-python | SoftLayer/CLI/block/snapshot/delete.py | cli | def cli(env, snapshot_id):
"""Deletes a snapshot on a given volume"""
block_manager = SoftLayer.BlockStorageManager(env.client)
deleted = block_manager.delete_snapshot(snapshot_id)
if deleted:
click.echo('Snapshot %s deleted' % snapshot_id) | python | def cli(env, snapshot_id):
"""Deletes a snapshot on a given volume"""
block_manager = SoftLayer.BlockStorageManager(env.client)
deleted = block_manager.delete_snapshot(snapshot_id)
if deleted:
click.echo('Snapshot %s deleted' % snapshot_id) | [
"def",
"cli",
"(",
"env",
",",
"snapshot_id",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"deleted",
"=",
"block_manager",
".",
"delete_snapshot",
"(",
"snapshot_id",
")",
"if",
"deleted",
":",
"cl... | Deletes a snapshot on a given volume | [
"Deletes",
"a",
"snapshot",
"on",
"a",
"given",
"volume"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/snapshot/delete.py#L12-L18 |
softlayer/softlayer-python | fabfile.py | release | def release(version, force=False):
"""Perform a release. Example:
$ fab release:3.0.0
"""
if version.startswith("v"):
abort("Version should not start with 'v'")
version_str = "v%s" % version
clean()
local("pip install wheel")
puts(" * Uploading to PyPI")
upload()
pu... | python | def release(version, force=False):
"""Perform a release. Example:
$ fab release:3.0.0
"""
if version.startswith("v"):
abort("Version should not start with 'v'")
version_str = "v%s" % version
clean()
local("pip install wheel")
puts(" * Uploading to PyPI")
upload()
pu... | [
"def",
"release",
"(",
"version",
",",
"force",
"=",
"False",
")",
":",
"if",
"version",
".",
"startswith",
"(",
"\"v\"",
")",
":",
"abort",
"(",
"\"Version should not start with 'v'\"",
")",
"version_str",
"=",
"\"v%s\"",
"%",
"version",
"clean",
"(",
")",
... | Perform a release. Example:
$ fab release:3.0.0 | [
"Perform",
"a",
"release",
".",
"Example",
":"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/fabfile.py#L27-L49 |
softlayer/softlayer-python | SoftLayer/CLI/file/snapshot/cancel.py | cli | def cli(env, volume_id, reason, immediate):
"""Cancel existing snapshot space for a given volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
raise exceptions.CLIAbort('Aborted')
cancelled = file_st... | python | def cli(env, volume_id, reason, immediate):
"""Cancel existing snapshot space for a given volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
raise exceptions.CLIAbort('Aborted')
cancelled = file_st... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"reason",
",",
"immediate",
")",
":",
"file_storage_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"if",
"not",
"(",
"env",
".",
"skip_confirmations",
"or",
"formatting"... | Cancel existing snapshot space for a given volume. | [
"Cancel",
"existing",
"snapshot",
"space",
"for",
"a",
"given",
"volume",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/cancel.py#L20-L40 |
softlayer/softlayer-python | SoftLayer/CLI/block/detail.py | cli | def cli(env, volume_id):
"""Display details for a specified volume."""
block_manager = SoftLayer.BlockStorageManager(env.client)
block_volume = block_manager.get_block_volume_details(volume_id)
block_volume = utils.NestedDict(block_volume)
table = formatting.KeyValueTable(['Name', 'Value'])
tab... | python | def cli(env, volume_id):
"""Display details for a specified volume."""
block_manager = SoftLayer.BlockStorageManager(env.client)
block_volume = block_manager.get_block_volume_details(volume_id)
block_volume = utils.NestedDict(block_volume)
table = formatting.KeyValueTable(['Name', 'Value'])
tab... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"block_volume",
"=",
"block_manager",
".",
"get_block_volume_details",
"(",
"volume_id",
")",
"block_volume",
"="... | Display details for a specified volume. | [
"Display",
"details",
"for",
"a",
"specified",
"volume",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/detail.py#L14-L111 |
softlayer/softlayer-python | SoftLayer/CLI/securitygroup/event_log.py | get_by_request_id | def get_by_request_id(env, request_id):
"""Search for event logs by request id"""
mgr = SoftLayer.NetworkManager(env.client)
logs = mgr.get_event_logs_by_request_id(request_id)
table = formatting.Table(COLUMNS)
table.align['metadata'] = "l"
for log in logs:
metadata = json.dumps(json.... | python | def get_by_request_id(env, request_id):
"""Search for event logs by request id"""
mgr = SoftLayer.NetworkManager(env.client)
logs = mgr.get_event_logs_by_request_id(request_id)
table = formatting.Table(COLUMNS)
table.align['metadata'] = "l"
for log in logs:
metadata = json.dumps(json.... | [
"def",
"get_by_request_id",
"(",
"env",
",",
"request_id",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"logs",
"=",
"mgr",
".",
"get_event_logs_by_request_id",
"(",
"request_id",
")",
"table",
"=",
"formatting",
... | Search for event logs by request id | [
"Search",
"for",
"event",
"logs",
"by",
"request",
"id"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/event_log.py#L18-L32 |
softlayer/softlayer-python | SoftLayer/CLI/ticket/create.py | cli | def cli(env, title, subject_id, body, hardware_identifier, virtual_identifier, priority):
"""Create a support ticket."""
ticket_mgr = SoftLayer.TicketManager(env.client)
if body is None:
body = click.edit('\n\n' + ticket.TEMPLATE_MSG)
created_ticket = ticket_mgr.create_ticket(
title=tit... | python | def cli(env, title, subject_id, body, hardware_identifier, virtual_identifier, priority):
"""Create a support ticket."""
ticket_mgr = SoftLayer.TicketManager(env.client)
if body is None:
body = click.edit('\n\n' + ticket.TEMPLATE_MSG)
created_ticket = ticket_mgr.create_ticket(
title=tit... | [
"def",
"cli",
"(",
"env",
",",
"title",
",",
"subject_id",
",",
"body",
",",
"hardware_identifier",
",",
"virtual_identifier",
",",
"priority",
")",
":",
"ticket_mgr",
"=",
"SoftLayer",
".",
"TicketManager",
"(",
"env",
".",
"client",
")",
"if",
"body",
"i... | Create a support ticket. | [
"Create",
"a",
"support",
"ticket",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/create.py#L26-L48 |
softlayer/softlayer-python | SoftLayer/CLI/file/detail.py | cli | def cli(env, volume_id):
"""Display details for a specified volume."""
file_manager = SoftLayer.FileStorageManager(env.client)
file_volume = file_manager.get_file_volume_details(volume_id)
file_volume = utils.NestedDict(file_volume)
table = formatting.KeyValueTable(['Name', 'Value'])
table.alig... | python | def cli(env, volume_id):
"""Display details for a specified volume."""
file_manager = SoftLayer.FileStorageManager(env.client)
file_volume = file_manager.get_file_volume_details(volume_id)
file_volume = utils.NestedDict(file_volume)
table = formatting.KeyValueTable(['Name', 'Value'])
table.alig... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
")",
":",
"file_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"file_volume",
"=",
"file_manager",
".",
"get_file_volume_details",
"(",
"volume_id",
")",
"file_volume",
"=",
"u... | Display details for a specified volume. | [
"Display",
"details",
"for",
"a",
"specified",
"volume",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/detail.py#L14-L127 |
softlayer/softlayer-python | SoftLayer/CLI/file/replication/failback.py | cli | def cli(env, volume_id, replicant_id):
"""Failback a file volume from the given replicant volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
success = file_storage_manager.failback_from_replicant(
volume_id,
replicant_id
)
if success:
click.echo("Fai... | python | def cli(env, volume_id, replicant_id):
"""Failback a file volume from the given replicant volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
success = file_storage_manager.failback_from_replicant(
volume_id,
replicant_id
)
if success:
click.echo("Fai... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"replicant_id",
")",
":",
"file_storage_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"success",
"=",
"file_storage_manager",
".",
"failback_from_replicant",
"(",
"volume_id"... | Failback a file volume from the given replicant volume. | [
"Failback",
"a",
"file",
"volume",
"from",
"the",
"given",
"replicant",
"volume",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/replication/failback.py#L14-L26 |
softlayer/softlayer-python | SoftLayer/CLI/file/snapshot/restore.py | cli | def cli(env, volume_id, snapshot_id):
"""Restore file volume using a given snapshot"""
file_manager = SoftLayer.FileStorageManager(env.client)
success = file_manager.restore_from_snapshot(volume_id, snapshot_id)
if success:
click.echo('File volume %s is being restored using snapshot %s'
... | python | def cli(env, volume_id, snapshot_id):
"""Restore file volume using a given snapshot"""
file_manager = SoftLayer.FileStorageManager(env.client)
success = file_manager.restore_from_snapshot(volume_id, snapshot_id)
if success:
click.echo('File volume %s is being restored using snapshot %s'
... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"snapshot_id",
")",
":",
"file_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"success",
"=",
"file_manager",
".",
"restore_from_snapshot",
"(",
"volume_id",
",",
"snapsho... | Restore file volume using a given snapshot | [
"Restore",
"file",
"volume",
"using",
"a",
"given",
"snapshot"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/restore.py#L15-L22 |
softlayer/softlayer-python | SoftLayer/CLI/config/show.py | cli | def cli(env):
"""Show current configuration."""
settings = config.get_settings_from_client(env.client)
env.fout(config.config_table(settings)) | python | def cli(env):
"""Show current configuration."""
settings = config.get_settings_from_client(env.client)
env.fout(config.config_table(settings)) | [
"def",
"cli",
"(",
"env",
")",
":",
"settings",
"=",
"config",
".",
"get_settings_from_client",
"(",
"env",
".",
"client",
")",
"env",
".",
"fout",
"(",
"config",
".",
"config_table",
"(",
"settings",
")",
")"
] | Show current configuration. | [
"Show",
"current",
"configuration",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/config/show.py#L12-L16 |
softlayer/softlayer-python | SoftLayer/CLI/file/order.py | cli | def cli(env, storage_type, size, iops, tier,
location, snapshot_size, service_offering, billing):
"""Order a file storage volume.
Valid size and iops options can be found here:
https://console.bluemix.net/docs/infrastructure/FileStorage/index.html#provisioning
"""
file_manager = SoftLayer.F... | python | def cli(env, storage_type, size, iops, tier,
location, snapshot_size, service_offering, billing):
"""Order a file storage volume.
Valid size and iops options can be found here:
https://console.bluemix.net/docs/infrastructure/FileStorage/index.html#provisioning
"""
file_manager = SoftLayer.F... | [
"def",
"cli",
"(",
"env",
",",
"storage_type",
",",
"size",
",",
"iops",
",",
"tier",
",",
"location",
",",
"snapshot_size",
",",
"service_offering",
",",
"billing",
")",
":",
"file_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"c... | Order a file storage volume.
Valid size and iops options can be found here:
https://console.bluemix.net/docs/infrastructure/FileStorage/index.html#provisioning | [
"Order",
"a",
"file",
"storage",
"volume",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/order.py#L50-L119 |
softlayer/softlayer-python | SoftLayer/CLI/virt/capacity/create_guest.py | cli | def cli(env, **args):
"""Allows for creating a virtual guest in a reserved capacity."""
create_args = _parse_create_args(env.client, args)
create_args['primary_disk'] = args.get('primary_disk')
manager = CapacityManager(env.client)
capacity_id = args.get('capacity_id')
test = args.get('test')
... | python | def cli(env, **args):
"""Allows for creating a virtual guest in a reserved capacity."""
create_args = _parse_create_args(env.client, args)
create_args['primary_disk'] = args.get('primary_disk')
manager = CapacityManager(env.client)
capacity_id = args.get('capacity_id')
test = args.get('test')
... | [
"def",
"cli",
"(",
"env",
",",
"*",
"*",
"args",
")",
":",
"create_args",
"=",
"_parse_create_args",
"(",
"env",
".",
"client",
",",
"args",
")",
"create_args",
"[",
"'primary_disk'",
"]",
"=",
"args",
".",
"get",
"(",
"'primary_disk'",
")",
"manager",
... | Allows for creating a virtual guest in a reserved capacity. | [
"Allows",
"for",
"creating",
"a",
"virtual",
"guest",
"in",
"a",
"reserved",
"capacity",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_guest.py#L36-L47 |
softlayer/softlayer-python | SoftLayer/CLI/sshkey/print.py | cli | def cli(env, identifier, out_file):
"""Prints out an SSH key to the screen."""
mgr = SoftLayer.SshKeyManager(env.client)
key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')
key = mgr.get_key(key_id)
if out_file:
with open(path.expanduser(out_file), 'w') as pub_file:
... | python | def cli(env, identifier, out_file):
"""Prints out an SSH key to the screen."""
mgr = SoftLayer.SshKeyManager(env.client)
key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')
key = mgr.get_key(key_id)
if out_file:
with open(path.expanduser(out_file), 'w') as pub_file:
... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"out_file",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"SshKeyManager",
"(",
"env",
".",
"client",
")",
"key_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"identifier",
",",
... | Prints out an SSH key to the screen. | [
"Prints",
"out",
"an",
"SSH",
"key",
"to",
"the",
"screen",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/sshkey/print.py#L19-L36 |
softlayer/softlayer-python | SoftLayer/managers/object_storage.py | ObjectStorageManager.list_endpoints | def list_endpoints(self):
"""Lists the known object storage endpoints."""
_filter = {
'hubNetworkStorage': {'vendorName': {'operation': 'Swift'}},
}
endpoints = []
network_storage = self.client.call('Account',
'getHubNetworkS... | python | def list_endpoints(self):
"""Lists the known object storage endpoints."""
_filter = {
'hubNetworkStorage': {'vendorName': {'operation': 'Swift'}},
}
endpoints = []
network_storage = self.client.call('Account',
'getHubNetworkS... | [
"def",
"list_endpoints",
"(",
"self",
")",
":",
"_filter",
"=",
"{",
"'hubNetworkStorage'",
":",
"{",
"'vendorName'",
":",
"{",
"'operation'",
":",
"'Swift'",
"}",
"}",
",",
"}",
"endpoints",
"=",
"[",
"]",
"network_storage",
"=",
"self",
".",
"client",
... | Lists the known object storage endpoints. | [
"Lists",
"the",
"known",
"object",
"storage",
"endpoints",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/object_storage.py#L35-L54 |
softlayer/softlayer-python | SoftLayer/managers/object_storage.py | ObjectStorageManager.delete_credential | def delete_credential(self, identifier, credential_id=None):
"""Delete the object storage credential.
:param int id: The object storage account identifier.
:param int credential_id: The credential id to be deleted.
"""
credential = {
'id': credential_id
}
... | python | def delete_credential(self, identifier, credential_id=None):
"""Delete the object storage credential.
:param int id: The object storage account identifier.
:param int credential_id: The credential id to be deleted.
"""
credential = {
'id': credential_id
}
... | [
"def",
"delete_credential",
"(",
"self",
",",
"identifier",
",",
"credential_id",
"=",
"None",
")",
":",
"credential",
"=",
"{",
"'id'",
":",
"credential_id",
"}",
"return",
"self",
".",
"client",
".",
"call",
"(",
"'SoftLayer_Network_Storage_Hub_Cleversafe_Accoun... | Delete the object storage credential.
:param int id: The object storage account identifier.
:param int credential_id: The credential id to be deleted. | [
"Delete",
"the",
"object",
"storage",
"credential",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/object_storage.py#L66-L78 |
softlayer/softlayer-python | SoftLayer/CLI/hardware/list.py | cli | def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag, columns, limit):
"""List hardware servers."""
manager = SoftLayer.HardwareManager(env.client)
servers = manager.list_hardware(hostname=hostname,
domain=domain,
... | python | def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag, columns, limit):
"""List hardware servers."""
manager = SoftLayer.HardwareManager(env.client)
servers = manager.list_hardware(hostname=hostname,
domain=domain,
... | [
"def",
"cli",
"(",
"env",
",",
"sortby",
",",
"cpu",
",",
"domain",
",",
"datacenter",
",",
"hostname",
",",
"memory",
",",
"network",
",",
"tag",
",",
"columns",
",",
"limit",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"HardwareManager",
"(",
"env",
... | List hardware servers. | [
"List",
"hardware",
"servers",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/list.py#L62-L83 |
softlayer/softlayer-python | SoftLayer/CLI/user/edit_details.py | cli | def cli(env, user, template):
"""Edit a Users details
JSON strings should be enclosed in '' and each item should be enclosed in ""
:Example: slcli user edit-details testUser -t '{"firstName": "Test", "lastName": "Testerson"}'
"""
mgr = SoftLayer.UserManager(env.client)
user_id = helpers.resolv... | python | def cli(env, user, template):
"""Edit a Users details
JSON strings should be enclosed in '' and each item should be enclosed in ""
:Example: slcli user edit-details testUser -t '{"firstName": "Test", "lastName": "Testerson"}'
"""
mgr = SoftLayer.UserManager(env.client)
user_id = helpers.resolv... | [
"def",
"cli",
"(",
"env",
",",
"user",
",",
"template",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"UserManager",
"(",
"env",
".",
"client",
")",
"user_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"user",
",",
"'username'",... | Edit a Users details
JSON strings should be enclosed in '' and each item should be enclosed in ""
:Example: slcli user edit-details testUser -t '{"firstName": "Test", "lastName": "Testerson"}' | [
"Edit",
"a",
"Users",
"details"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/edit_details.py#L20-L43 |
softlayer/softlayer-python | SoftLayer/CLI/subnet/lookup.py | cli | def cli(env, ip_address):
"""Find an IP address and display its subnet and device info."""
mgr = SoftLayer.NetworkManager(env.client)
addr_info = mgr.ip_lookup(ip_address)
if not addr_info:
raise exceptions.CLIAbort('Not found')
table = formatting.KeyValueTable(['name', 'value'])
tab... | python | def cli(env, ip_address):
"""Find an IP address and display its subnet and device info."""
mgr = SoftLayer.NetworkManager(env.client)
addr_info = mgr.ip_lookup(ip_address)
if not addr_info:
raise exceptions.CLIAbort('Not found')
table = formatting.KeyValueTable(['name', 'value'])
tab... | [
"def",
"cli",
"(",
"env",
",",
"ip_address",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"addr_info",
"=",
"mgr",
".",
"ip_lookup",
"(",
"ip_address",
")",
"if",
"not",
"addr_info",
":",
"raise",
"exceptions"... | Find an IP address and display its subnet and device info. | [
"Find",
"an",
"IP",
"address",
"and",
"display",
"its",
"subnet",
"and",
"device",
"info",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/lookup.py#L15-L60 |
softlayer/softlayer-python | SoftLayer/CLI/image/import.py | cli | def cli(env, name, note, os_code, uri, ibm_api_key, root_key_crn, wrapped_dek,
cloud_init, byol, is_encrypted):
"""Import an image.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucke... | python | def cli(env, name, note, os_code, uri, ibm_api_key, root_key_crn, wrapped_dek,
cloud_init, byol, is_encrypted):
"""Import an image.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucke... | [
"def",
"cli",
"(",
"env",
",",
"name",
",",
"note",
",",
"os_code",
",",
"uri",
",",
"ibm_api_key",
",",
"root_key_crn",
",",
"wrapped_dek",
",",
"cloud_init",
",",
"byol",
",",
"is_encrypted",
")",
":",
"image_mgr",
"=",
"SoftLayer",
".",
"ImageManager",
... | Import an image.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage | [
"Import",
"an",
"image",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/import.py#L46-L80 |
softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/update.py | cli | def cli(env, context_id, friendly_name, remote_peer, preshared_key,
phase1_auth, phase1_crypto, phase1_dh, phase1_key_ttl, phase2_auth,
phase2_crypto, phase2_dh, phase2_forward_secrecy, phase2_key_ttl):
"""Update tunnel context properties.
Updates are made atomically, so either all are accepted... | python | def cli(env, context_id, friendly_name, remote_peer, preshared_key,
phase1_auth, phase1_crypto, phase1_dh, phase1_key_ttl, phase2_auth,
phase2_crypto, phase2_dh, phase2_forward_secrecy, phase2_key_ttl):
"""Update tunnel context properties.
Updates are made atomically, so either all are accepted... | [
"def",
"cli",
"(",
"env",
",",
"context_id",
",",
"friendly_name",
",",
"remote_peer",
",",
"preshared_key",
",",
"phase1_auth",
",",
"phase1_crypto",
",",
"phase1_dh",
",",
"phase1_key_ttl",
",",
"phase2_auth",
",",
"phase2_crypto",
",",
"phase2_dh",
",",
"phas... | Update tunnel context properties.
Updates are made atomically, so either all are accepted or none are.
Key life values must be in the range 120-172800.
Phase 2 perfect forward secrecy must be in the range 0-1.
A separate configuration request should be made to realize changes on
network devices. | [
"Update",
"tunnel",
"context",
"properties",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/update.py#L68-L101 |
softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.add_internal_subnet | def add_internal_subnet(self, context_id, subnet_id):
"""Add an internal subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the internal subnet.
:return bool: True if internal subnet addition... | python | def add_internal_subnet(self, context_id, subnet_id):
"""Add an internal subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the internal subnet.
:return bool: True if internal subnet addition... | [
"def",
"add_internal_subnet",
"(",
"self",
",",
"context_id",
",",
"subnet_id",
")",
":",
"return",
"self",
".",
"context",
".",
"addPrivateSubnetToNetworkTunnel",
"(",
"subnet_id",
",",
"id",
"=",
"context_id",
")"
] | Add an internal subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the internal subnet.
:return bool: True if internal subnet addition was successful. | [
"Add",
"an",
"internal",
"subnet",
"to",
"a",
"tunnel",
"context",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L31-L39 |
softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.add_remote_subnet | def add_remote_subnet(self, context_id, subnet_id):
"""Adds a remote subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the remote subnet.
:return bool: True if remote subnet addition was suc... | python | def add_remote_subnet(self, context_id, subnet_id):
"""Adds a remote subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the remote subnet.
:return bool: True if remote subnet addition was suc... | [
"def",
"add_remote_subnet",
"(",
"self",
",",
"context_id",
",",
"subnet_id",
")",
":",
"return",
"self",
".",
"context",
".",
"addCustomerSubnetToNetworkTunnel",
"(",
"subnet_id",
",",
"id",
"=",
"context_id",
")"
] | Adds a remote subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the remote subnet.
:return bool: True if remote subnet addition was successful. | [
"Adds",
"a",
"remote",
"subnet",
"to",
"a",
"tunnel",
"context",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L41-L49 |
softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.add_service_subnet | def add_service_subnet(self, context_id, subnet_id):
"""Adds a service subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the service subnet.
:return bool: True if service subnet addition was... | python | def add_service_subnet(self, context_id, subnet_id):
"""Adds a service subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the service subnet.
:return bool: True if service subnet addition was... | [
"def",
"add_service_subnet",
"(",
"self",
",",
"context_id",
",",
"subnet_id",
")",
":",
"return",
"self",
".",
"context",
".",
"addServiceSubnetToNetworkTunnel",
"(",
"subnet_id",
",",
"id",
"=",
"context_id",
")"
] | Adds a service subnet to a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int subnet_id: The id-value representing the service subnet.
:return bool: True if service subnet addition was successful. | [
"Adds",
"a",
"service",
"subnet",
"to",
"a",
"tunnel",
"context",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L51-L59 |
softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.create_remote_subnet | def create_remote_subnet(self, account_id, identifier, cidr):
"""Creates a remote subnet on the given account.
:param string account_id: The account identifier.
:param string identifier: The network identifier of the remote subnet.
:param string cidr: The CIDR value of the remote subnet... | python | def create_remote_subnet(self, account_id, identifier, cidr):
"""Creates a remote subnet on the given account.
:param string account_id: The account identifier.
:param string identifier: The network identifier of the remote subnet.
:param string cidr: The CIDR value of the remote subnet... | [
"def",
"create_remote_subnet",
"(",
"self",
",",
"account_id",
",",
"identifier",
",",
"cidr",
")",
":",
"return",
"self",
".",
"remote_subnet",
".",
"createObject",
"(",
"{",
"'accountId'",
":",
"account_id",
",",
"'cidr'",
":",
"cidr",
",",
"'networkIdentifi... | Creates a remote subnet on the given account.
:param string account_id: The account identifier.
:param string identifier: The network identifier of the remote subnet.
:param string cidr: The CIDR value of the remote subnet.
:return dict: Mapping of properties for the new remote subnet. | [
"Creates",
"a",
"remote",
"subnet",
"on",
"the",
"given",
"account",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L69-L81 |
softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.create_translation | def create_translation(self, context_id, static_ip, remote_ip, notes):
"""Creates an address translation on a tunnel context/
:param int context_id: The id-value representing the context instance.
:param string static_ip: The IP address value representing the
internal side of the... | python | def create_translation(self, context_id, static_ip, remote_ip, notes):
"""Creates an address translation on a tunnel context/
:param int context_id: The id-value representing the context instance.
:param string static_ip: The IP address value representing the
internal side of the... | [
"def",
"create_translation",
"(",
"self",
",",
"context_id",
",",
"static_ip",
",",
"remote_ip",
",",
"notes",
")",
":",
"return",
"self",
".",
"context",
".",
"createAddressTranslation",
"(",
"{",
"'customerIpAddress'",
":",
"remote_ip",
",",
"'internalIpAddress'... | Creates an address translation on a tunnel context/
:param int context_id: The id-value representing the context instance.
:param string static_ip: The IP address value representing the
internal side of the translation entry,
:param string remote_ip: The IP address value represen... | [
"Creates",
"an",
"address",
"translation",
"on",
"a",
"tunnel",
"context",
"/"
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L83-L98 |
softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.get_tunnel_context | def get_tunnel_context(self, context_id, **kwargs):
"""Retrieves the network tunnel context instance.
:param int context_id: The id-value representing the context instance.
:return dict: Mapping of properties for the tunnel context.
:raise SoftLayerAPIError: If a context cannot be found... | python | def get_tunnel_context(self, context_id, **kwargs):
"""Retrieves the network tunnel context instance.
:param int context_id: The id-value representing the context instance.
:return dict: Mapping of properties for the tunnel context.
:raise SoftLayerAPIError: If a context cannot be found... | [
"def",
"get_tunnel_context",
"(",
"self",
",",
"context_id",
",",
"*",
"*",
"kwargs",
")",
":",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"kwargs",
".",
"get",
"(",
"'filter'",
")",
"or",
"{",
"}",
")",
"_filter",
"[",
"'networkTunnelContexts'",
"... | Retrieves the network tunnel context instance.
:param int context_id: The id-value representing the context instance.
:return dict: Mapping of properties for the tunnel context.
:raise SoftLayerAPIError: If a context cannot be found. | [
"Retrieves",
"the",
"network",
"tunnel",
"context",
"instance",
"."
] | train | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L108-L124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.