id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,700 | 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"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/event_log.py#L18-L32 |
1,701 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/create.py#L26-L48 |
1,702 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/replication/failback.py#L14-L26 |
1,703 | 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"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/restore.py#L15-L22 |
1,704 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/config/show.py#L12-L16 |
1,705 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/order.py#L50-L119 |
1,706 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_guest.py#L36-L47 |
1,707 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/sshkey/print.py#L19-L36 |
1,708 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/object_storage.py#L35-L54 |
1,709 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/object_storage.py#L66-L78 |
1,710 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/list.py#L62-L83 |
1,711 | 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"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/edit_details.py#L20-L43 |
1,712 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/lookup.py#L15-L60 |
1,713 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/import.py#L46-L80 |
1,714 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/update.py#L68-L101 |
1,715 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L31-L39 |
1,716 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L41-L49 |
1,717 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L51-L59 |
1,718 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L69-L81 |
1,719 | 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",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L108-L124 |
1,720 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.get_translation | def get_translation(self, context_id, translation_id):
"""Retrieves a translation entry for the given id values.
:param int context_id: The id-value representing the context instance.
:param int translation_id: The id-value representing the translation
instance.
:return d... | python | def get_translation(self, context_id, translation_id):
"""Retrieves a translation entry for the given id values.
:param int context_id: The id-value representing the context instance.
:param int translation_id: The id-value representing the translation
instance.
:return d... | [
"def",
"get_translation",
"(",
"self",
",",
"context_id",
",",
"translation_id",
")",
":",
"translation",
"=",
"next",
"(",
"(",
"x",
"for",
"x",
"in",
"self",
".",
"get_translations",
"(",
"context_id",
")",
"if",
"x",
"[",
"'id'",
"]",
"==",
"translati... | Retrieves a translation entry for the given id values.
:param int context_id: The id-value representing the context instance.
:param int translation_id: The id-value representing the translation
instance.
:return dict: Mapping of properties for the translation entry.
:rai... | [
"Retrieves",
"a",
"translation",
"entry",
"for",
"the",
"given",
"id",
"values",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L126-L141 |
1,721 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.get_translations | def get_translations(self, context_id):
"""Retrieves all translation entries for a tunnel context.
:param int context_id: The id-value representing the context instance.
:return list(dict): Translations associated with the given context
"""
_mask = ('[mask[addressTranslations[cu... | python | def get_translations(self, context_id):
"""Retrieves all translation entries for a tunnel context.
:param int context_id: The id-value representing the context instance.
:return list(dict): Translations associated with the given context
"""
_mask = ('[mask[addressTranslations[cu... | [
"def",
"get_translations",
"(",
"self",
",",
"context_id",
")",
":",
"_mask",
"=",
"(",
"'[mask[addressTranslations[customerIpAddressRecord,'",
"'internalIpAddressRecord]]]'",
")",
"context",
"=",
"self",
".",
"get_tunnel_context",
"(",
"context_id",
",",
"mask",
"=",
... | Retrieves all translation entries for a tunnel context.
:param int context_id: The id-value representing the context instance.
:return list(dict): Translations associated with the given context | [
"Retrieves",
"all",
"translation",
"entries",
"for",
"a",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L143-L160 |
1,722 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.remove_internal_subnet | def remove_internal_subnet(self, context_id, subnet_id):
"""Remove an internal subnet from 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 ... | python | def remove_internal_subnet(self, context_id, subnet_id):
"""Remove an internal subnet from 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 ... | [
"def",
"remove_internal_subnet",
"(",
"self",
",",
"context_id",
",",
"subnet_id",
")",
":",
"return",
"self",
".",
"context",
".",
"removePrivateSubnetFromNetworkTunnel",
"(",
"subnet_id",
",",
"id",
"=",
"context_id",
")"
] | Remove an internal subnet from 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 removal was successful. | [
"Remove",
"an",
"internal",
"subnet",
"from",
"a",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L169-L177 |
1,723 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.remove_remote_subnet | def remove_remote_subnet(self, context_id, subnet_id):
"""Removes a remote subnet from 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 removal ... | python | def remove_remote_subnet(self, context_id, subnet_id):
"""Removes a remote subnet from 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 removal ... | [
"def",
"remove_remote_subnet",
"(",
"self",
",",
"context_id",
",",
"subnet_id",
")",
":",
"return",
"self",
".",
"context",
".",
"removeCustomerSubnetFromNetworkTunnel",
"(",
"subnet_id",
",",
"id",
"=",
"context_id",
")"
] | Removes a remote subnet from 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 removal was successful. | [
"Removes",
"a",
"remote",
"subnet",
"from",
"a",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L179-L187 |
1,724 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.remove_service_subnet | def remove_service_subnet(self, context_id, subnet_id):
"""Removes a service subnet from 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 remo... | python | def remove_service_subnet(self, context_id, subnet_id):
"""Removes a service subnet from 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 remo... | [
"def",
"remove_service_subnet",
"(",
"self",
",",
"context_id",
",",
"subnet_id",
")",
":",
"return",
"self",
".",
"context",
".",
"removeServiceSubnetFromNetworkTunnel",
"(",
"subnet_id",
",",
"id",
"=",
"context_id",
")"
] | Removes a service subnet from 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 removal was successful. | [
"Removes",
"a",
"service",
"subnet",
"from",
"a",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L189-L197 |
1,725 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.remove_translation | def remove_translation(self, context_id, translation_id):
"""Removes a translation entry from a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int translation_id: The id-value representing the translation.
:return bool: True if translation ... | python | def remove_translation(self, context_id, translation_id):
"""Removes a translation entry from a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int translation_id: The id-value representing the translation.
:return bool: True if translation ... | [
"def",
"remove_translation",
"(",
"self",
",",
"context_id",
",",
"translation_id",
")",
":",
"return",
"self",
".",
"context",
".",
"deleteAddressTranslation",
"(",
"translation_id",
",",
"id",
"=",
"context_id",
")"
] | Removes a translation entry from a tunnel context.
:param int context_id: The id-value representing the context instance.
:param int translation_id: The id-value representing the translation.
:return bool: True if translation entry removal was successful. | [
"Removes",
"a",
"translation",
"entry",
"from",
"a",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L199-L207 |
1,726 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.update_translation | def update_translation(self, context_id, translation_id, static_ip=None,
remote_ip=None, notes=None):
"""Updates an address translation entry using the given values.
:param int context_id: The id-value representing the context instance.
:param dict template: A key-val... | python | def update_translation(self, context_id, translation_id, static_ip=None,
remote_ip=None, notes=None):
"""Updates an address translation entry using the given values.
:param int context_id: The id-value representing the context instance.
:param dict template: A key-val... | [
"def",
"update_translation",
"(",
"self",
",",
"context_id",
",",
"translation_id",
",",
"static_ip",
"=",
"None",
",",
"remote_ip",
"=",
"None",
",",
"notes",
"=",
"None",
")",
":",
"translation",
"=",
"self",
".",
"get_translation",
"(",
"context_id",
",",... | Updates an address translation entry using the given values.
:param int context_id: The id-value representing the context instance.
:param dict template: A key-value mapping of translation properties.
:param string static_ip: The static IP address value to update.
:param string remote_i... | [
"Updates",
"an",
"address",
"translation",
"entry",
"using",
"the",
"given",
"values",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L209-L231 |
1,727 | softlayer/softlayer-python | SoftLayer/managers/ipsec.py | IPSECManager.update_tunnel_context | def update_tunnel_context(self, context_id, friendly_name=None,
remote_peer=None, preshared_key=None,
phase1_auth=None, phase1_crypto=None,
phase1_dh=None, phase1_key_ttl=None,
phase2_auth=None, phase... | python | def update_tunnel_context(self, context_id, friendly_name=None,
remote_peer=None, preshared_key=None,
phase1_auth=None, phase1_crypto=None,
phase1_dh=None, phase1_key_ttl=None,
phase2_auth=None, phase... | [
"def",
"update_tunnel_context",
"(",
"self",
",",
"context_id",
",",
"friendly_name",
"=",
"None",
",",
"remote_peer",
"=",
"None",
",",
"preshared_key",
"=",
"None",
",",
"phase1_auth",
"=",
"None",
",",
"phase1_crypto",
"=",
"None",
",",
"phase1_dh",
"=",
... | Updates a tunnel context using the given values.
:param string context_id: The id-value representing the context.
:param string friendly_name: The friendly name value to update.
:param string remote_peer: The remote peer IP address value to update.
:param string preshared_key: The presh... | [
"Updates",
"a",
"tunnel",
"context",
"using",
"the",
"given",
"values",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ipsec.py#L233-L286 |
1,728 | softlayer/softlayer-python | SoftLayer/CLI/object_storage/credential/create.py | cli | def cli(env, identifier):
"""Create credentials for an IBM Cloud Object Storage Account"""
mgr = SoftLayer.ObjectStorageManager(env.client)
credential = mgr.create_credential(identifier)
table = formatting.Table(['id', 'password', 'username', 'type_name'])
table.sortby = 'id'
table.add_row([
... | python | def cli(env, identifier):
"""Create credentials for an IBM Cloud Object Storage Account"""
mgr = SoftLayer.ObjectStorageManager(env.client)
credential = mgr.create_credential(identifier)
table = formatting.Table(['id', 'password', 'username', 'type_name'])
table.sortby = 'id'
table.add_row([
... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"ObjectStorageManager",
"(",
"env",
".",
"client",
")",
"credential",
"=",
"mgr",
".",
"create_credential",
"(",
"identifier",
")",
"table",
"=",
"formatting",
".",
"Table... | Create credentials for an IBM Cloud Object Storage Account | [
"Create",
"credentials",
"for",
"an",
"IBM",
"Cloud",
"Object",
"Storage",
"Account"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/object_storage/credential/create.py#L14-L28 |
1,729 | softlayer/softlayer-python | SoftLayer/CLI/image/list.py | cli | def cli(env, name, public):
"""List images."""
image_mgr = SoftLayer.ImageManager(env.client)
images = []
if public in [False, None]:
for image in image_mgr.list_private_images(name=name,
mask=image_mod.MASK):
images.append(image)
... | python | def cli(env, name, public):
"""List images."""
image_mgr = SoftLayer.ImageManager(env.client)
images = []
if public in [False, None]:
for image in image_mgr.list_private_images(name=name,
mask=image_mod.MASK):
images.append(image)
... | [
"def",
"cli",
"(",
"env",
",",
"name",
",",
"public",
")",
":",
"image_mgr",
"=",
"SoftLayer",
".",
"ImageManager",
"(",
"env",
".",
"client",
")",
"images",
"=",
"[",
"]",
"if",
"public",
"in",
"[",
"False",
",",
"None",
"]",
":",
"for",
"image",
... | List images. | [
"List",
"images",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/list.py#L20-L58 |
1,730 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/subnet/add.py | cli | def cli(env, context_id, subnet_id, subnet_type, network_identifier):
"""Add a subnet to an IPSEC tunnel context.
A subnet id may be specified to link to the existing tunnel context.
Otherwise, a network identifier in CIDR notation should be specified,
indicating that a subnet resource should first be... | python | def cli(env, context_id, subnet_id, subnet_type, network_identifier):
"""Add a subnet to an IPSEC tunnel context.
A subnet id may be specified to link to the existing tunnel context.
Otherwise, a network identifier in CIDR notation should be specified,
indicating that a subnet resource should first be... | [
"def",
"cli",
"(",
"env",
",",
"context_id",
",",
"subnet_id",
",",
"subnet_type",
",",
"network_identifier",
")",
":",
"create_remote",
"=",
"False",
"if",
"subnet_id",
"is",
"None",
":",
"if",
"network_identifier",
"is",
"None",
":",
"raise",
"ArgumentError"... | Add a subnet to an IPSEC tunnel context.
A subnet id may be specified to link to the existing tunnel context.
Otherwise, a network identifier in CIDR notation should be specified,
indicating that a subnet resource should first be created before associating
it with the tunnel context. Note that this is... | [
"Add",
"a",
"subnet",
"to",
"an",
"IPSEC",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/subnet/add.py#L33-L81 |
1,731 | softlayer/softlayer-python | SoftLayer/CLI/virt/placementgroup/list.py | cli | def cli(env):
"""List placement groups."""
manager = PlacementManager(env.client)
result = manager.list()
table = formatting.Table(
["Id", "Name", "Backend Router", "Rule", "Guests", "Created"],
title="Placement Groups"
)
for group in result:
table.add_row([
g... | python | def cli(env):
"""List placement groups."""
manager = PlacementManager(env.client)
result = manager.list()
table = formatting.Table(
["Id", "Name", "Backend Router", "Rule", "Guests", "Created"],
title="Placement Groups"
)
for group in result:
table.add_row([
g... | [
"def",
"cli",
"(",
"env",
")",
":",
"manager",
"=",
"PlacementManager",
"(",
"env",
".",
"client",
")",
"result",
"=",
"manager",
".",
"list",
"(",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"\"Id\"",
",",
"\"Name\"",
",",
"\"Backend Rout... | List placement groups. | [
"List",
"placement",
"groups",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/placementgroup/list.py#L12-L30 |
1,732 | softlayer/softlayer-python | SoftLayer/CLI/account/events.py | cli | def cli(env, ack_all):
"""Summary and acknowledgement of upcoming and ongoing maintenance events"""
manager = AccountManager(env.client)
events = manager.get_upcoming_events()
if ack_all:
for event in events:
result = manager.ack_event(event['id'])
event['acknowledgedFl... | python | def cli(env, ack_all):
"""Summary and acknowledgement of upcoming and ongoing maintenance events"""
manager = AccountManager(env.client)
events = manager.get_upcoming_events()
if ack_all:
for event in events:
result = manager.ack_event(event['id'])
event['acknowledgedFl... | [
"def",
"cli",
"(",
"env",
",",
"ack_all",
")",
":",
"manager",
"=",
"AccountManager",
"(",
"env",
".",
"client",
")",
"events",
"=",
"manager",
".",
"get_upcoming_events",
"(",
")",
"if",
"ack_all",
":",
"for",
"event",
"in",
"events",
":",
"result",
"... | Summary and acknowledgement of upcoming and ongoing maintenance events | [
"Summary",
"and",
"acknowledgement",
"of",
"upcoming",
"and",
"ongoing",
"maintenance",
"events"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/events.py#L15-L25 |
1,733 | softlayer/softlayer-python | SoftLayer/CLI/account/events.py | event_table | def event_table(events):
"""Formats a table for events"""
table = formatting.Table([
"Id",
"Start Date",
"End Date",
"Subject",
"Status",
"Acknowledged",
"Updates",
"Impacted Resources"
], title="Upcoming Events")
table.align['Subject'] = '... | python | def event_table(events):
"""Formats a table for events"""
table = formatting.Table([
"Id",
"Start Date",
"End Date",
"Subject",
"Status",
"Acknowledged",
"Updates",
"Impacted Resources"
], title="Upcoming Events")
table.align['Subject'] = '... | [
"def",
"event_table",
"(",
"events",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"\"Id\"",
",",
"\"Start Date\"",
",",
"\"End Date\"",
",",
"\"Subject\"",
",",
"\"Status\"",
",",
"\"Acknowledged\"",
",",
"\"Updates\"",
",",
"\"Impacted Resource... | Formats a table for events | [
"Formats",
"a",
"table",
"for",
"events"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/events.py#L28-L54 |
1,734 | softlayer/softlayer-python | SoftLayer/CLI/block/access/password.py | cli | def cli(env, access_id, password):
"""Changes a password for a volume's access.
access id is the allowed_host_id from slcli block access-list
"""
block_manager = SoftLayer.BlockStorageManager(env.client)
result = block_manager.set_credential_password(access_id=access_id, password=password)
i... | python | def cli(env, access_id, password):
"""Changes a password for a volume's access.
access id is the allowed_host_id from slcli block access-list
"""
block_manager = SoftLayer.BlockStorageManager(env.client)
result = block_manager.set_credential_password(access_id=access_id, password=password)
i... | [
"def",
"cli",
"(",
"env",
",",
"access_id",
",",
"password",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"result",
"=",
"block_manager",
".",
"set_credential_password",
"(",
"access_id",
"=",
"access... | Changes a password for a volume's access.
access id is the allowed_host_id from slcli block access-list | [
"Changes",
"a",
"password",
"for",
"a",
"volume",
"s",
"access",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/access/password.py#L14-L27 |
1,735 | softlayer/softlayer-python | SoftLayer/CLI/cdn/detail.py | cli | def cli(env, account_id):
"""Detail a CDN Account."""
manager = SoftLayer.CDNManager(env.client)
account = manager.get_account(account_id)
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
table.add_row(['id', account['id']])
tabl... | python | def cli(env, account_id):
"""Detail a CDN Account."""
manager = SoftLayer.CDNManager(env.client)
account = manager.get_account(account_id)
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
table.add_row(['id', account['id']])
tabl... | [
"def",
"cli",
"(",
"env",
",",
"account_id",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"CDNManager",
"(",
"env",
".",
"client",
")",
"account",
"=",
"manager",
".",
"get_account",
"(",
"account_id",
")",
"table",
"=",
"formatting",
".",
"KeyValueTable",
... | Detail a CDN Account. | [
"Detail",
"a",
"CDN",
"Account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/cdn/detail.py#L14-L32 |
1,736 | softlayer/softlayer-python | SoftLayer/utils.py | lookup | def lookup(dic, key, *keys):
"""A generic dictionary access helper.
This helps simplify code that uses heavily nested dictionaries. It will
return None if any of the keys in *keys do not exist.
::
>>> lookup({'this': {'is': 'nested'}}, 'this', 'is')
nested
>>> lookup({}, 'thi... | python | def lookup(dic, key, *keys):
"""A generic dictionary access helper.
This helps simplify code that uses heavily nested dictionaries. It will
return None if any of the keys in *keys do not exist.
::
>>> lookup({'this': {'is': 'nested'}}, 'this', 'is')
nested
>>> lookup({}, 'thi... | [
"def",
"lookup",
"(",
"dic",
",",
"key",
",",
"*",
"keys",
")",
":",
"if",
"keys",
":",
"return",
"lookup",
"(",
"dic",
".",
"get",
"(",
"key",
",",
"{",
"}",
")",
",",
"keys",
"[",
"0",
"]",
",",
"*",
"keys",
"[",
"1",
":",
"]",
")",
"re... | A generic dictionary access helper.
This helps simplify code that uses heavily nested dictionaries. It will
return None if any of the keys in *keys do not exist.
::
>>> lookup({'this': {'is': 'nested'}}, 'this', 'is')
nested
>>> lookup({}, 'this', 'is')
None | [
"A",
"generic",
"dictionary",
"access",
"helper",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L24-L41 |
1,737 | softlayer/softlayer-python | SoftLayer/utils.py | query_filter | def query_filter(query):
"""Translate a query-style string to a 'filter'.
Query can be the following formats:
Case Insensitive
'value' OR '*= value' Contains
'value*' OR '^= value' Begins with value
'*value' OR '$= value' Ends with value
'*value*' OR '_= value' Contains val... | python | def query_filter(query):
"""Translate a query-style string to a 'filter'.
Query can be the following formats:
Case Insensitive
'value' OR '*= value' Contains
'value*' OR '^= value' Begins with value
'*value' OR '$= value' Ends with value
'*value*' OR '_= value' Contains val... | [
"def",
"query_filter",
"(",
"query",
")",
":",
"try",
":",
"return",
"{",
"'operation'",
":",
"int",
"(",
"query",
")",
"}",
"except",
"ValueError",
":",
"pass",
"if",
"isinstance",
"(",
"query",
",",
"string_types",
")",
":",
"query",
"=",
"query",
".... | Translate a query-style string to a 'filter'.
Query can be the following formats:
Case Insensitive
'value' OR '*= value' Contains
'value*' OR '^= value' Begins with value
'*value' OR '$= value' Ends with value
'*value*' OR '_= value' Contains value
Case Sensitive
'~ ... | [
"Translate",
"a",
"query",
"-",
"style",
"string",
"to",
"a",
"filter",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L66-L108 |
1,738 | softlayer/softlayer-python | SoftLayer/utils.py | query_filter_date | def query_filter_date(start, end):
"""Query filters given start and end date.
:param start:YY-MM-DD
:param end: YY-MM-DD
"""
sdate = datetime.datetime.strptime(start, "%Y-%m-%d")
edate = datetime.datetime.strptime(end, "%Y-%m-%d")
startdate = "%s/%s/%s" % (sdate.month, sdate.day, sdate.year... | python | def query_filter_date(start, end):
"""Query filters given start and end date.
:param start:YY-MM-DD
:param end: YY-MM-DD
"""
sdate = datetime.datetime.strptime(start, "%Y-%m-%d")
edate = datetime.datetime.strptime(end, "%Y-%m-%d")
startdate = "%s/%s/%s" % (sdate.month, sdate.day, sdate.year... | [
"def",
"query_filter_date",
"(",
"start",
",",
"end",
")",
":",
"sdate",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"start",
",",
"\"%Y-%m-%d\"",
")",
"edate",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"end",
",",
"\"%Y-%m-%d\"",... | Query filters given start and end date.
:param start:YY-MM-DD
:param end: YY-MM-DD | [
"Query",
"filters",
"given",
"start",
"and",
"end",
"date",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L111-L127 |
1,739 | softlayer/softlayer-python | SoftLayer/utils.py | format_event_log_date | def format_event_log_date(date_string, utc):
"""Gets a date in the format that the SoftLayer_EventLog object likes.
:param string date_string: date in mm/dd/yyyy format
:param string utc: utc offset. Defaults to '+0000'
"""
user_date_format = "%m/%d/%Y"
user_date = datetime.datetime.strptime(d... | python | def format_event_log_date(date_string, utc):
"""Gets a date in the format that the SoftLayer_EventLog object likes.
:param string date_string: date in mm/dd/yyyy format
:param string utc: utc offset. Defaults to '+0000'
"""
user_date_format = "%m/%d/%Y"
user_date = datetime.datetime.strptime(d... | [
"def",
"format_event_log_date",
"(",
"date_string",
",",
"utc",
")",
":",
"user_date_format",
"=",
"\"%m/%d/%Y\"",
"user_date",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"date_string",
",",
"user_date_format",
")",
"dirty_time",
"=",
"user_date",
"."... | Gets a date in the format that the SoftLayer_EventLog object likes.
:param string date_string: date in mm/dd/yyyy format
:param string utc: utc offset. Defaults to '+0000' | [
"Gets",
"a",
"date",
"in",
"the",
"format",
"that",
"the",
"SoftLayer_EventLog",
"object",
"likes",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L130-L147 |
1,740 | softlayer/softlayer-python | SoftLayer/utils.py | event_log_filter_between_date | def event_log_filter_between_date(start, end, utc):
"""betweenDate Query filter that SoftLayer_EventLog likes
:param string start: lower bound date in mm/dd/yyyy format
:param string end: upper bound date in mm/dd/yyyy format
:param string utc: utc offset. Defaults to '+0000'
"""
return {
... | python | def event_log_filter_between_date(start, end, utc):
"""betweenDate Query filter that SoftLayer_EventLog likes
:param string start: lower bound date in mm/dd/yyyy format
:param string end: upper bound date in mm/dd/yyyy format
:param string utc: utc offset. Defaults to '+0000'
"""
return {
... | [
"def",
"event_log_filter_between_date",
"(",
"start",
",",
"end",
",",
"utc",
")",
":",
"return",
"{",
"'operation'",
":",
"'betweenDate'",
",",
"'options'",
":",
"[",
"{",
"'name'",
":",
"'startDate'",
",",
"'value'",
":",
"[",
"format_event_log_date",
"(",
... | betweenDate Query filter that SoftLayer_EventLog likes
:param string start: lower bound date in mm/dd/yyyy format
:param string end: upper bound date in mm/dd/yyyy format
:param string utc: utc offset. Defaults to '+0000' | [
"betweenDate",
"Query",
"filter",
"that",
"SoftLayer_EventLog",
"likes"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L150-L163 |
1,741 | softlayer/softlayer-python | SoftLayer/utils.py | resolve_ids | def resolve_ids(identifier, resolvers):
"""Resolves IDs given a list of functions.
:param string identifier: identifier string
:param list resolvers: a list of functions
:returns list:
"""
# Before doing anything, let's see if this is an integer
try:
return [int(identifier)]
ex... | python | def resolve_ids(identifier, resolvers):
"""Resolves IDs given a list of functions.
:param string identifier: identifier string
:param list resolvers: a list of functions
:returns list:
"""
# Before doing anything, let's see if this is an integer
try:
return [int(identifier)]
ex... | [
"def",
"resolve_ids",
"(",
"identifier",
",",
"resolvers",
")",
":",
"# Before doing anything, let's see if this is an integer",
"try",
":",
"return",
"[",
"int",
"(",
"identifier",
")",
"]",
"except",
"ValueError",
":",
"pass",
"# It was worth a shot",
"# This looks li... | Resolves IDs given a list of functions.
:param string identifier: identifier string
:param list resolvers: a list of functions
:returns list: | [
"Resolves",
"IDs",
"given",
"a",
"list",
"of",
"functions",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L215-L238 |
1,742 | softlayer/softlayer-python | SoftLayer/utils.py | is_ready | def is_ready(instance, pending=False):
"""Returns True if instance is ready to be used
:param Object instance: Hardware or Virt with transaction data retrieved from the API
:param bool pending: Wait for ALL transactions to finish?
:returns bool:
"""
last_reload = lookup(instance, 'lastOperatin... | python | def is_ready(instance, pending=False):
"""Returns True if instance is ready to be used
:param Object instance: Hardware or Virt with transaction data retrieved from the API
:param bool pending: Wait for ALL transactions to finish?
:returns bool:
"""
last_reload = lookup(instance, 'lastOperatin... | [
"def",
"is_ready",
"(",
"instance",
",",
"pending",
"=",
"False",
")",
":",
"last_reload",
"=",
"lookup",
"(",
"instance",
",",
"'lastOperatingSystemReload'",
",",
"'id'",
")",
"active_transaction",
"=",
"lookup",
"(",
"instance",
",",
"'activeTransaction'",
","... | Returns True if instance is ready to be used
:param Object instance: Hardware or Virt with transaction data retrieved from the API
:param bool pending: Wait for ALL transactions to finish?
:returns bool: | [
"Returns",
"True",
"if",
"instance",
"is",
"ready",
"to",
"be",
"used"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L254-L275 |
1,743 | softlayer/softlayer-python | SoftLayer/utils.py | clean_time | def clean_time(sltime, in_format='%Y-%m-%dT%H:%M:%S%z', out_format='%Y-%m-%d %H:%M'):
"""Easy way to format time strings
:param string sltime: A softlayer formatted time string
:param string in_format: Datetime format for strptime
:param string out_format: Datetime format for strftime
"""
try:
... | python | def clean_time(sltime, in_format='%Y-%m-%dT%H:%M:%S%z', out_format='%Y-%m-%d %H:%M'):
"""Easy way to format time strings
:param string sltime: A softlayer formatted time string
:param string in_format: Datetime format for strptime
:param string out_format: Datetime format for strftime
"""
try:
... | [
"def",
"clean_time",
"(",
"sltime",
",",
"in_format",
"=",
"'%Y-%m-%dT%H:%M:%S%z'",
",",
"out_format",
"=",
"'%Y-%m-%d %H:%M'",
")",
":",
"try",
":",
"clean",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"sltime",
",",
"in_format",
")",
"return",
... | Easy way to format time strings
:param string sltime: A softlayer formatted time string
:param string in_format: Datetime format for strptime
:param string out_format: Datetime format for strftime | [
"Easy",
"way",
"to",
"format",
"time",
"strings"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L301-L313 |
1,744 | softlayer/softlayer-python | SoftLayer/utils.py | NestedDict.to_dict | def to_dict(self):
"""Converts a NestedDict instance into a real dictionary.
This is needed for places where strict type checking is done.
"""
return {key: val.to_dict() if isinstance(val, NestedDict) else val
for key, val in self.items()} | python | def to_dict(self):
"""Converts a NestedDict instance into a real dictionary.
This is needed for places where strict type checking is done.
"""
return {key: val.to_dict() if isinstance(val, NestedDict) else val
for key, val in self.items()} | [
"def",
"to_dict",
"(",
"self",
")",
":",
"return",
"{",
"key",
":",
"val",
".",
"to_dict",
"(",
")",
"if",
"isinstance",
"(",
"val",
",",
"NestedDict",
")",
"else",
"val",
"for",
"key",
",",
"val",
"in",
"self",
".",
"items",
"(",
")",
"}"
] | Converts a NestedDict instance into a real dictionary.
This is needed for places where strict type checking is done. | [
"Converts",
"a",
"NestedDict",
"instance",
"into",
"a",
"real",
"dictionary",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/utils.py#L57-L63 |
1,745 | softlayer/softlayer-python | SoftLayer/CLI/firewall/cancel.py | cli | def cli(env, identifier):
"""Cancels a firewall."""
mgr = SoftLayer.FirewallManager(env.client)
firewall_type, firewall_id = firewall.parse_id(identifier)
if not (env.skip_confirmations or
formatting.confirm("This action will cancel a firewall from your "
"ac... | python | def cli(env, identifier):
"""Cancels a firewall."""
mgr = SoftLayer.FirewallManager(env.client)
firewall_type, firewall_id = firewall.parse_id(identifier)
if not (env.skip_confirmations or
formatting.confirm("This action will cancel a firewall from your "
"ac... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"FirewallManager",
"(",
"env",
".",
"client",
")",
"firewall_type",
",",
"firewall_id",
"=",
"firewall",
".",
"parse_id",
"(",
"identifier",
")",
"if",
"not",
"(",
"env"... | Cancels a firewall. | [
"Cancels",
"a",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/cancel.py#L16-L34 |
1,746 | softlayer/softlayer-python | SoftLayer/CLI/sshkey/add.py | cli | def cli(env, label, in_file, key, note):
"""Add a new SSH key."""
if in_file is None and key is None:
raise exceptions.ArgumentError(
'Either [-f | --in-file] or [-k | --key] arguments are required to add a key'
)
if in_file and key:
raise exceptions.ArgumentError(
... | python | def cli(env, label, in_file, key, note):
"""Add a new SSH key."""
if in_file is None and key is None:
raise exceptions.ArgumentError(
'Either [-f | --in-file] or [-k | --key] arguments are required to add a key'
)
if in_file and key:
raise exceptions.ArgumentError(
... | [
"def",
"cli",
"(",
"env",
",",
"label",
",",
"in_file",
",",
"key",
",",
"note",
")",
":",
"if",
"in_file",
"is",
"None",
"and",
"key",
"is",
"None",
":",
"raise",
"exceptions",
".",
"ArgumentError",
"(",
"'Either [-f | --in-file] or [-k | --key] arguments are... | Add a new SSH key. | [
"Add",
"a",
"new",
"SSH",
"key",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/sshkey/add.py#L20-L43 |
1,747 | softlayer/softlayer-python | SoftLayer/CLI/rwhois/show.py | cli | def cli(env):
"""Display the RWhois information for your account."""
mgr = SoftLayer.NetworkManager(env.client)
result = mgr.get_rwhois()
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
table.add_row(['Name', result['firstName'] + ' ... | python | def cli(env):
"""Display the RWhois information for your account."""
mgr = SoftLayer.NetworkManager(env.client)
result = mgr.get_rwhois()
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
table.add_row(['Name', result['firstName'] + ' ... | [
"def",
"cli",
"(",
"env",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"result",
"=",
"mgr",
".",
"get_rwhois",
"(",
")",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",
"[",
"'name'",
",",
"'value'",... | Display the RWhois information for your account. | [
"Display",
"the",
"RWhois",
"information",
"for",
"your",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/rwhois/show.py#L13-L34 |
1,748 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/translation/add.py | cli | def cli(env, context_id, static_ip, remote_ip, note):
"""Add an address translation to an IPSEC tunnel context.
A separate configuration request should be made to realize changes on
network devices.
"""
manager = SoftLayer.IPSECManager(env.client)
# ensure context can be retrieved by given id
... | python | def cli(env, context_id, static_ip, remote_ip, note):
"""Add an address translation to an IPSEC tunnel context.
A separate configuration request should be made to realize changes on
network devices.
"""
manager = SoftLayer.IPSECManager(env.client)
# ensure context can be retrieved by given id
... | [
"def",
"cli",
"(",
"env",
",",
"context_id",
",",
"static_ip",
",",
"remote_ip",
",",
"note",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"IPSECManager",
"(",
"env",
".",
"client",
")",
"# ensure context can be retrieved by given id",
"manager",
".",
"get_tunnel... | Add an address translation to an IPSEC tunnel context.
A separate configuration request should be made to realize changes on
network devices. | [
"Add",
"an",
"address",
"translation",
"to",
"an",
"IPSEC",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/translation/add.py#L27-L42 |
1,749 | softlayer/softlayer-python | SoftLayer/CLI/ssl/list.py | cli | def cli(env, status, sortby):
"""List SSL certificates."""
manager = SoftLayer.SSLManager(env.client)
certificates = manager.list_certs(status)
table = formatting.Table(['id',
'common_name',
'days_until_expire',
... | python | def cli(env, status, sortby):
"""List SSL certificates."""
manager = SoftLayer.SSLManager(env.client)
certificates = manager.list_certs(status)
table = formatting.Table(['id',
'common_name',
'days_until_expire',
... | [
"def",
"cli",
"(",
"env",
",",
"status",
",",
"sortby",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"SSLManager",
"(",
"env",
".",
"client",
")",
"certificates",
"=",
"manager",
".",
"list_certs",
"(",
"status",
")",
"table",
"=",
"formatting",
".",
"T... | List SSL certificates. | [
"List",
"SSL",
"certificates",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/list.py#L24-L42 |
1,750 | softlayer/softlayer-python | SoftLayer/CLI/loadbal/health_checks.py | cli | def cli(env):
"""List health check types."""
mgr = SoftLayer.LoadBalancerManager(env.client)
hc_types = mgr.get_hc_types()
table = formatting.KeyValueTable(['ID', 'Name'])
table.align['ID'] = 'l'
table.align['Name'] = 'l'
table.sortby = 'ID'
for hc_type in hc_types:
table.add_r... | python | def cli(env):
"""List health check types."""
mgr = SoftLayer.LoadBalancerManager(env.client)
hc_types = mgr.get_hc_types()
table = formatting.KeyValueTable(['ID', 'Name'])
table.align['ID'] = 'l'
table.align['Name'] = 'l'
table.sortby = 'ID'
for hc_type in hc_types:
table.add_r... | [
"def",
"cli",
"(",
"env",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"LoadBalancerManager",
"(",
"env",
".",
"client",
")",
"hc_types",
"=",
"mgr",
".",
"get_hc_types",
"(",
")",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",
"[",
"'ID'",
",",
"'N... | List health check types. | [
"List",
"health",
"check",
"types",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/health_checks.py#L13-L26 |
1,751 | softlayer/softlayer-python | SoftLayer/CLI/object_storage/credential/limit.py | cli | def cli(env, identifier):
"""Credential limits for this IBM Cloud Object Storage account."""
mgr = SoftLayer.ObjectStorageManager(env.client)
credential_limit = mgr.limit_credential(identifier)
table = formatting.Table(['limit'])
table.add_row([
credential_limit,
])
env.fout(table) | python | def cli(env, identifier):
"""Credential limits for this IBM Cloud Object Storage account."""
mgr = SoftLayer.ObjectStorageManager(env.client)
credential_limit = mgr.limit_credential(identifier)
table = formatting.Table(['limit'])
table.add_row([
credential_limit,
])
env.fout(table) | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"ObjectStorageManager",
"(",
"env",
".",
"client",
")",
"credential_limit",
"=",
"mgr",
".",
"limit_credential",
"(",
"identifier",
")",
"table",
"=",
"formatting",
".",
"... | Credential limits for this IBM Cloud Object Storage account. | [
"Credential",
"limits",
"for",
"this",
"IBM",
"Cloud",
"Object",
"Storage",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/object_storage/credential/limit.py#L14-L24 |
1,752 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/detail.py | cli | def cli(env, context_id, include):
"""List IPSEC VPN tunnel context details.
Additional resources can be joined using multiple instances of the
include option, for which the following choices are available.
\b
at: address translations
is: internal subnets
rs: remote subnets
sr: statica... | python | def cli(env, context_id, include):
"""List IPSEC VPN tunnel context details.
Additional resources can be joined using multiple instances of the
include option, for which the following choices are available.
\b
at: address translations
is: internal subnets
rs: remote subnets
sr: statica... | [
"def",
"cli",
"(",
"env",
",",
"context_id",
",",
"include",
")",
":",
"mask",
"=",
"_get_tunnel_context_mask",
"(",
"(",
"'at'",
"in",
"include",
")",
",",
"(",
"'is'",
"in",
"include",
")",
",",
"(",
"'rs'",
"in",
"include",
")",
",",
"(",
"'sr'",
... | List IPSEC VPN tunnel context details.
Additional resources can be joined using multiple instances of the
include option, for which the following choices are available.
\b
at: address translations
is: internal subnets
rs: remote subnets
sr: statically routed subnets
ss: service subnets | [
"List",
"IPSEC",
"VPN",
"tunnel",
"context",
"details",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/detail.py#L20-L60 |
1,753 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/detail.py | _get_address_translations_table | def _get_address_translations_table(address_translations):
"""Yields a formatted table to print address translations.
:param List[dict] address_translations: List of address translations.
:return Table: Formatted for address translation output.
"""
table = formatting.Table(['id',
... | python | def _get_address_translations_table(address_translations):
"""Yields a formatted table to print address translations.
:param List[dict] address_translations: List of address translations.
:return Table: Formatted for address translation output.
"""
table = formatting.Table(['id',
... | [
"def",
"_get_address_translations_table",
"(",
"address_translations",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'static IP address'",
",",
"'static IP address id'",
",",
"'remote IP address'",
",",
"'remote IP address id'",
",",
"'note... | Yields a formatted table to print address translations.
:param List[dict] address_translations: List of address translations.
:return Table: Formatted for address translation output. | [
"Yields",
"a",
"formatted",
"table",
"to",
"print",
"address",
"translations",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/detail.py#L63-L84 |
1,754 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/detail.py | _get_subnets_table | def _get_subnets_table(subnets):
"""Yields a formatted table to print subnet details.
:param List[dict] subnets: List of subnets.
:return Table: Formatted for subnet output.
"""
table = formatting.Table(['id',
'network identifier',
'cidr',... | python | def _get_subnets_table(subnets):
"""Yields a formatted table to print subnet details.
:param List[dict] subnets: List of subnets.
:return Table: Formatted for subnet output.
"""
table = formatting.Table(['id',
'network identifier',
'cidr',... | [
"def",
"_get_subnets_table",
"(",
"subnets",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'network identifier'",
",",
"'cidr'",
",",
"'note'",
"]",
")",
"for",
"subnet",
"in",
"subnets",
":",
"table",
".",
"add_row",
"(",
"... | Yields a formatted table to print subnet details.
:param List[dict] subnets: List of subnets.
:return Table: Formatted for subnet output. | [
"Yields",
"a",
"formatted",
"table",
"to",
"print",
"subnet",
"details",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/detail.py#L87-L102 |
1,755 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/detail.py | _get_tunnel_context_mask | def _get_tunnel_context_mask(address_translations=False,
internal_subnets=False,
remote_subnets=False,
static_subnets=False,
service_subnets=False):
"""Yields a mask object for a tunnel context.
... | python | def _get_tunnel_context_mask(address_translations=False,
internal_subnets=False,
remote_subnets=False,
static_subnets=False,
service_subnets=False):
"""Yields a mask object for a tunnel context.
... | [
"def",
"_get_tunnel_context_mask",
"(",
"address_translations",
"=",
"False",
",",
"internal_subnets",
"=",
"False",
",",
"remote_subnets",
"=",
"False",
",",
"static_subnets",
"=",
"False",
",",
"service_subnets",
"=",
"False",
")",
":",
"entries",
"=",
"[",
"'... | Yields a mask object for a tunnel context.
All exposed properties on the tunnel context service are included in
the constructed mask. Additional joins may be requested.
:param bool address_translations: Whether to join the context's address
translation entries.
:param bool internal_subnets:... | [
"Yields",
"a",
"mask",
"object",
"for",
"a",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/detail.py#L105-L157 |
1,756 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/detail.py | _get_context_table | def _get_context_table(context):
"""Yields a formatted table to print context details.
:param dict context: The tunnel context
:return Table: Formatted for tunnel context output
"""
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
... | python | def _get_context_table(context):
"""Yields a formatted table to print context details.
:param dict context: The tunnel context
:return Table: Formatted for tunnel context output
"""
table = formatting.KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
... | [
"def",
"_get_context_table",
"(",
"context",
")",
":",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",
"[",
"'name'",
",",
"'value'",
"]",
")",
"table",
".",
"align",
"[",
"'name'",
"]",
"=",
"'r'",
"table",
".",
"align",
"[",
"'value'",
"]",
"=... | Yields a formatted table to print context details.
:param dict context: The tunnel context
:return Table: Formatted for tunnel context output | [
"Yields",
"a",
"formatted",
"table",
"to",
"print",
"context",
"details",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/detail.py#L160-L196 |
1,757 | softlayer/softlayer-python | SoftLayer/CLI/file/replication/failover.py | cli | def cli(env, volume_id, replicant_id, immediate):
"""Failover a file volume to the given replicant volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
success = file_storage_manager.failover_to_replicant(
volume_id,
replicant_id,
immediate
)
if succes... | python | def cli(env, volume_id, replicant_id, immediate):
"""Failover a file volume to the given replicant volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
success = file_storage_manager.failover_to_replicant(
volume_id,
replicant_id,
immediate
)
if succes... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"replicant_id",
",",
"immediate",
")",
":",
"file_storage_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"success",
"=",
"file_storage_manager",
".",
"failover_to_replicant",
... | Failover a file volume to the given replicant volume. | [
"Failover",
"a",
"file",
"volume",
"to",
"the",
"given",
"replicant",
"volume",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/replication/failover.py#L17-L30 |
1,758 | softlayer/softlayer-python | SoftLayer/CLI/file/count.py | cli | def cli(env, sortby, datacenter):
"""List number of file storage volumes per datacenter."""
file_manager = SoftLayer.FileStorageManager(env.client)
mask = "mask[serviceResource[datacenter[name]],"\
"replicationPartners[serviceResource[datacenter[name]]]]"
file_volumes = file_manager.list_file... | python | def cli(env, sortby, datacenter):
"""List number of file storage volumes per datacenter."""
file_manager = SoftLayer.FileStorageManager(env.client)
mask = "mask[serviceResource[datacenter[name]],"\
"replicationPartners[serviceResource[datacenter[name]]]]"
file_volumes = file_manager.list_file... | [
"def",
"cli",
"(",
"env",
",",
"sortby",
",",
"datacenter",
")",
":",
"file_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"mask",
"=",
"\"mask[serviceResource[datacenter[name]],\"",
"\"replicationPartners[serviceResource[datacent... | List number of file storage volumes per datacenter. | [
"List",
"number",
"of",
"file",
"storage",
"volumes",
"per",
"datacenter",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/count.py#L19-L41 |
1,759 | softlayer/softlayer-python | SoftLayer/CLI/hardware/create_options.py | cli | def cli(env):
"""Server order options for a given chassis."""
hardware_manager = hardware.HardwareManager(env.client)
options = hardware_manager.get_create_options()
tables = []
# Datacenters
dc_table = formatting.Table(['datacenter', 'value'])
dc_table.sortby = 'value'
for location i... | python | def cli(env):
"""Server order options for a given chassis."""
hardware_manager = hardware.HardwareManager(env.client)
options = hardware_manager.get_create_options()
tables = []
# Datacenters
dc_table = formatting.Table(['datacenter', 'value'])
dc_table.sortby = 'value'
for location i... | [
"def",
"cli",
"(",
"env",
")",
":",
"hardware_manager",
"=",
"hardware",
".",
"HardwareManager",
"(",
"env",
".",
"client",
")",
"options",
"=",
"hardware_manager",
".",
"get_create_options",
"(",
")",
"tables",
"=",
"[",
"]",
"# Datacenters",
"dc_table",
"=... | Server order options for a given chassis. | [
"Server",
"order",
"options",
"for",
"a",
"given",
"chassis",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/create_options.py#L13-L56 |
1,760 | softlayer/softlayer-python | SoftLayer/CLI/firewall/__init__.py | parse_id | def parse_id(input_id):
"""Helper package to retrieve the actual IDs.
:param input_id: the ID provided by the user
:returns: A list of valid IDs
"""
key_value = input_id.split(':')
if len(key_value) != 2:
raise exceptions.CLIAbort(
'Invalid ID %s: ID should be of the form x... | python | def parse_id(input_id):
"""Helper package to retrieve the actual IDs.
:param input_id: the ID provided by the user
:returns: A list of valid IDs
"""
key_value = input_id.split(':')
if len(key_value) != 2:
raise exceptions.CLIAbort(
'Invalid ID %s: ID should be of the form x... | [
"def",
"parse_id",
"(",
"input_id",
")",
":",
"key_value",
"=",
"input_id",
".",
"split",
"(",
"':'",
")",
"if",
"len",
"(",
"key_value",
")",
"!=",
"2",
":",
"raise",
"exceptions",
".",
"CLIAbort",
"(",
"'Invalid ID %s: ID should be of the form xxx:yyy'",
"%"... | Helper package to retrieve the actual IDs.
:param input_id: the ID provided by the user
:returns: A list of valid IDs | [
"Helper",
"package",
"to",
"retrieve",
"the",
"actual",
"IDs",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/__init__.py#L7-L18 |
1,761 | softlayer/softlayer-python | SoftLayer/CLI/call_api.py | _build_filters | def _build_filters(_filters):
"""Builds filters using the filter options passed into the CLI.
This only supports the equals keyword at the moment.
"""
root = utils.NestedDict({})
for _filter in _filters:
operation = None
for operation, token in SPLIT_TOKENS:
# split "som... | python | def _build_filters(_filters):
"""Builds filters using the filter options passed into the CLI.
This only supports the equals keyword at the moment.
"""
root = utils.NestedDict({})
for _filter in _filters:
operation = None
for operation, token in SPLIT_TOKENS:
# split "som... | [
"def",
"_build_filters",
"(",
"_filters",
")",
":",
"root",
"=",
"utils",
".",
"NestedDict",
"(",
"{",
"}",
")",
"for",
"_filter",
"in",
"_filters",
":",
"operation",
"=",
"None",
"for",
"operation",
",",
"token",
"in",
"SPLIT_TOKENS",
":",
"# split \"some... | Builds filters using the filter options passed into the CLI.
This only supports the equals keyword at the moment. | [
"Builds",
"filters",
"using",
"the",
"filter",
"options",
"passed",
"into",
"the",
"CLI",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/call_api.py#L16-L53 |
1,762 | softlayer/softlayer-python | SoftLayer/CLI/call_api.py | cli | def cli(env, service, method, parameters, _id, _filters, mask, limit, offset,
output_python=False):
"""Call arbitrary API endpoints with the given SERVICE and METHOD.
Example::
slcli call-api Account getObject
slcli call-api Account getVirtualGuests --limit=10 --mask=id,hostname
... | python | def cli(env, service, method, parameters, _id, _filters, mask, limit, offset,
output_python=False):
"""Call arbitrary API endpoints with the given SERVICE and METHOD.
Example::
slcli call-api Account getObject
slcli call-api Account getVirtualGuests --limit=10 --mask=id,hostname
... | [
"def",
"cli",
"(",
"env",
",",
"service",
",",
"method",
",",
"parameters",
",",
"_id",
",",
"_filters",
",",
"mask",
",",
"limit",
",",
"offset",
",",
"output_python",
"=",
"False",
")",
":",
"args",
"=",
"[",
"service",
",",
"method",
"]",
"+",
"... | Call arbitrary API endpoints with the given SERVICE and METHOD.
Example::
slcli call-api Account getObject
slcli call-api Account getVirtualGuests --limit=10 --mask=id,hostname
slcli call-api Virtual_Guest getObject --id=12345
slcli call-api Metric_Tracking_Object getBandwidthData ... | [
"Call",
"arbitrary",
"API",
"endpoints",
"with",
"the",
"given",
"SERVICE",
"and",
"METHOD",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/call_api.py#L86-L118 |
1,763 | softlayer/softlayer-python | SoftLayer/CLI/block/snapshot/list.py | cli | def cli(env, volume_id, sortby, columns):
"""List block storage snapshots."""
block_manager = SoftLayer.BlockStorageManager(env.client)
snapshots = block_manager.get_block_volume_snapshot_list(
volume_id,
mask=columns.mask()
)
table = formatting.Table(columns.columns)
table.sort... | python | def cli(env, volume_id, sortby, columns):
"""List block storage snapshots."""
block_manager = SoftLayer.BlockStorageManager(env.client)
snapshots = block_manager.get_block_volume_snapshot_list(
volume_id,
mask=columns.mask()
)
table = formatting.Table(columns.columns)
table.sort... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"sortby",
",",
"columns",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"snapshots",
"=",
"block_manager",
".",
"get_block_volume_snapshot_list",
"(",
"... | List block storage snapshots. | [
"List",
"block",
"storage",
"snapshots",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/snapshot/list.py#L38-L53 |
1,764 | softlayer/softlayer-python | SoftLayer/CLI/order/place.py | cli | def cli(env, package_keyname, location, preset, verify, billing, complex_type,
quantity, extras, order_items):
"""Place or verify an order.
This CLI command is used for placing/verifying an order of the specified package in
the given location (denoted by a datacenter's long name). Orders made via t... | python | def cli(env, package_keyname, location, preset, verify, billing, complex_type,
quantity, extras, order_items):
"""Place or verify an order.
This CLI command is used for placing/verifying an order of the specified package in
the given location (denoted by a datacenter's long name). Orders made via t... | [
"def",
"cli",
"(",
"env",
",",
"package_keyname",
",",
"location",
",",
"preset",
",",
"verify",
",",
"billing",
",",
"complex_type",
",",
"quantity",
",",
"extras",
",",
"order_items",
")",
":",
"manager",
"=",
"ordering",
".",
"OrderingManager",
"(",
"en... | Place or verify an order.
This CLI command is used for placing/verifying an order of the specified package in
the given location (denoted by a datacenter's long name). Orders made via the CLI
can then be converted to be made programmatically by calling
SoftLayer.OrderingManager.place_order() with the s... | [
"Place",
"or",
"verify",
"an",
"order",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/order/place.py#L41-L120 |
1,765 | softlayer/softlayer-python | SoftLayer/CLI/sshkey/edit.py | cli | def cli(env, identifier, label, note):
"""Edits an SSH key."""
mgr = SoftLayer.SshKeyManager(env.client)
key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')
if not mgr.edit_key(key_id, label=label, notes=note):
raise exceptions.CLIAbort('Failed to edit SSH key') | python | def cli(env, identifier, label, note):
"""Edits an SSH key."""
mgr = SoftLayer.SshKeyManager(env.client)
key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')
if not mgr.edit_key(key_id, label=label, notes=note):
raise exceptions.CLIAbort('Failed to edit SSH key') | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"label",
",",
"note",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"SshKeyManager",
"(",
"env",
".",
"client",
")",
"key_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"identifi... | Edits an SSH key. | [
"Edits",
"an",
"SSH",
"key",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/sshkey/edit.py#L17-L25 |
1,766 | softlayer/softlayer-python | SoftLayer/CLI/securitygroup/delete.py | cli | def cli(env, securitygroup_id):
"""Deletes the given security group"""
mgr = SoftLayer.NetworkManager(env.client)
if not mgr.delete_securitygroup(securitygroup_id):
raise exceptions.CLIAbort("Failed to delete security group") | python | def cli(env, securitygroup_id):
"""Deletes the given security group"""
mgr = SoftLayer.NetworkManager(env.client)
if not mgr.delete_securitygroup(securitygroup_id):
raise exceptions.CLIAbort("Failed to delete security group") | [
"def",
"cli",
"(",
"env",
",",
"securitygroup_id",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"if",
"not",
"mgr",
".",
"delete_securitygroup",
"(",
"securitygroup_id",
")",
":",
"raise",
"exceptions",
".",
"CL... | Deletes the given security group | [
"Deletes",
"the",
"given",
"security",
"group"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/delete.py#L13-L17 |
1,767 | softlayer/softlayer-python | SoftLayer/CLI/globalip/create.py | cli | def cli(env, ipv6, test):
"""Creates a global IP."""
mgr = SoftLayer.NetworkManager(env.client)
version = 4
if ipv6:
version = 6
if not (test or env.skip_confirmations):
if not formatting.confirm("This action will incur charges on your "
"account.... | python | def cli(env, ipv6, test):
"""Creates a global IP."""
mgr = SoftLayer.NetworkManager(env.client)
version = 4
if ipv6:
version = 6
if not (test or env.skip_confirmations):
if not formatting.confirm("This action will incur charges on your "
"account.... | [
"def",
"cli",
"(",
"env",
",",
"ipv6",
",",
"test",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"version",
"=",
"4",
"if",
"ipv6",
":",
"version",
"=",
"6",
"if",
"not",
"(",
"test",
"or",
"env",
".",... | Creates a global IP. | [
"Creates",
"a",
"global",
"IP",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/globalip/create.py#L16-L44 |
1,768 | softlayer/softlayer-python | SoftLayer/CLI/vpn/ipsec/translation/remove.py | cli | def cli(env, context_id, translation_id):
"""Remove a translation entry from an IPSEC tunnel context.
A separate configuration request should be made to realize changes on
network devices.
"""
manager = SoftLayer.IPSECManager(env.client)
# ensure translation can be retrieved by given id
man... | python | def cli(env, context_id, translation_id):
"""Remove a translation entry from an IPSEC tunnel context.
A separate configuration request should be made to realize changes on
network devices.
"""
manager = SoftLayer.IPSECManager(env.client)
# ensure translation can be retrieved by given id
man... | [
"def",
"cli",
"(",
"env",
",",
"context_id",
",",
"translation_id",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"IPSECManager",
"(",
"env",
".",
"client",
")",
"# ensure translation can be retrieved by given id",
"manager",
".",
"get_translation",
"(",
"context_id",... | Remove a translation entry from an IPSEC tunnel context.
A separate configuration request should be made to realize changes on
network devices. | [
"Remove",
"a",
"translation",
"entry",
"from",
"an",
"IPSEC",
"tunnel",
"context",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/vpn/ipsec/translation/remove.py#L19-L33 |
1,769 | softlayer/softlayer-python | SoftLayer/CLI/virt/list.py | cli | def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network,
hourly, monthly, tag, columns, limit):
"""List virtual servers."""
vsi = SoftLayer.VSManager(env.client)
guests = vsi.list_instances(hourly=hourly,
monthly=monthly,
... | python | def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network,
hourly, monthly, tag, columns, limit):
"""List virtual servers."""
vsi = SoftLayer.VSManager(env.client)
guests = vsi.list_instances(hourly=hourly,
monthly=monthly,
... | [
"def",
"cli",
"(",
"env",
",",
"sortby",
",",
"cpu",
",",
"domain",
",",
"datacenter",
",",
"hostname",
",",
"memory",
",",
"network",
",",
"hourly",
",",
"monthly",
",",
"tag",
",",
"columns",
",",
"limit",
")",
":",
"vsi",
"=",
"SoftLayer",
".",
... | List virtual servers. | [
"List",
"virtual",
"servers",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/list.py#L70-L93 |
1,770 | softlayer/softlayer-python | SoftLayer/CLI/sshkey/remove.py | cli | def cli(env, identifier):
"""Permanently removes an SSH key."""
mgr = SoftLayer.SshKeyManager(env.client)
key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')
if not (env.skip_confirmations or formatting.no_going_back(key_id)):
raise exceptions.CLIAbort('Aborted')
mgr.delete_... | python | def cli(env, identifier):
"""Permanently removes an SSH key."""
mgr = SoftLayer.SshKeyManager(env.client)
key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')
if not (env.skip_confirmations or formatting.no_going_back(key_id)):
raise exceptions.CLIAbort('Aborted')
mgr.delete_... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"SshKeyManager",
"(",
"env",
".",
"client",
")",
"key_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"identifier",
",",
"'SshKey'",
")",
... | Permanently removes an SSH key. | [
"Permanently",
"removes",
"an",
"SSH",
"key",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/sshkey/remove.py#L16-L24 |
1,771 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | format_output | def format_output(data, fmt='table'): # pylint: disable=R0911,R0912
"""Given some data, will format it for console output.
:param data: One of: String, Table, FormattedItem, List, Tuple,
SequentialOutput
:param string fmt (optional): One of: table, raw, json, python
"""
if isinsta... | python | def format_output(data, fmt='table'): # pylint: disable=R0911,R0912
"""Given some data, will format it for console output.
:param data: One of: String, Table, FormattedItem, List, Tuple,
SequentialOutput
:param string fmt (optional): One of: table, raw, json, python
"""
if isinsta... | [
"def",
"format_output",
"(",
"data",
",",
"fmt",
"=",
"'table'",
")",
":",
"# pylint: disable=R0911,R0912",
"if",
"isinstance",
"(",
"data",
",",
"utils",
".",
"string_types",
")",
":",
"if",
"fmt",
"in",
"(",
"'json'",
",",
"'jsonraw'",
")",
":",
"return"... | Given some data, will format it for console output.
:param data: One of: String, Table, FormattedItem, List, Tuple,
SequentialOutput
:param string fmt (optional): One of: table, raw, json, python | [
"Given",
"some",
"data",
"will",
"format",
"it",
"for",
"console",
"output",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L26-L76 |
1,772 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | transaction_status | def transaction_status(transaction):
"""Returns a FormattedItem describing the given transaction.
:param item: An object capable of having an active transaction
"""
if not transaction or not transaction.get('transactionStatus'):
return blank()
return FormattedItem(
transaction[... | python | def transaction_status(transaction):
"""Returns a FormattedItem describing the given transaction.
:param item: An object capable of having an active transaction
"""
if not transaction or not transaction.get('transactionStatus'):
return blank()
return FormattedItem(
transaction[... | [
"def",
"transaction_status",
"(",
"transaction",
")",
":",
"if",
"not",
"transaction",
"or",
"not",
"transaction",
".",
"get",
"(",
"'transactionStatus'",
")",
":",
"return",
"blank",
"(",
")",
"return",
"FormattedItem",
"(",
"transaction",
"[",
"'transactionSta... | Returns a FormattedItem describing the given transaction.
:param item: An object capable of having an active transaction | [
"Returns",
"a",
"FormattedItem",
"describing",
"the",
"given",
"transaction",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L162-L172 |
1,773 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | tags | def tags(tag_references):
"""Returns a formatted list of tags."""
if not tag_references:
return blank()
tag_row = []
for tag_detail in tag_references:
tag = utils.lookup(tag_detail, 'tag', 'name')
if tag is not None:
tag_row.append(tag)
return listing(tag_row, s... | python | def tags(tag_references):
"""Returns a formatted list of tags."""
if not tag_references:
return blank()
tag_row = []
for tag_detail in tag_references:
tag = utils.lookup(tag_detail, 'tag', 'name')
if tag is not None:
tag_row.append(tag)
return listing(tag_row, s... | [
"def",
"tags",
"(",
"tag_references",
")",
":",
"if",
"not",
"tag_references",
":",
"return",
"blank",
"(",
")",
"tag_row",
"=",
"[",
"]",
"for",
"tag_detail",
"in",
"tag_references",
":",
"tag",
"=",
"utils",
".",
"lookup",
"(",
"tag_detail",
",",
"'tag... | Returns a formatted list of tags. | [
"Returns",
"a",
"formatted",
"list",
"of",
"tags",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L175-L186 |
1,774 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | confirm | def confirm(prompt_str, default=False):
"""Show a confirmation prompt to a command-line user.
:param string prompt_str: prompt to give to the user
:param bool default: Default value to True or False
"""
if default:
default_str = 'y'
prompt = '%s [Y/n]' % prompt_str
else:
... | python | def confirm(prompt_str, default=False):
"""Show a confirmation prompt to a command-line user.
:param string prompt_str: prompt to give to the user
:param bool default: Default value to True or False
"""
if default:
default_str = 'y'
prompt = '%s [Y/n]' % prompt_str
else:
... | [
"def",
"confirm",
"(",
"prompt_str",
",",
"default",
"=",
"False",
")",
":",
"if",
"default",
":",
"default_str",
"=",
"'y'",
"prompt",
"=",
"'%s [Y/n]'",
"%",
"prompt_str",
"else",
":",
"default_str",
"=",
"'n'",
"prompt",
"=",
"'%s [y/N]'",
"%",
"prompt_... | Show a confirmation prompt to a command-line user.
:param string prompt_str: prompt to give to the user
:param bool default: Default value to True or False | [
"Show",
"a",
"confirmation",
"prompt",
"to",
"a",
"command",
"-",
"line",
"user",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L189-L206 |
1,775 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | no_going_back | def no_going_back(confirmation):
"""Show a confirmation to a user.
:param confirmation str: the string the user has to enter in order to
confirm their action.
"""
if not confirmation:
confirmation = 'yes'
prompt = ('This action cannot be undone! Type "%s" or pr... | python | def no_going_back(confirmation):
"""Show a confirmation to a user.
:param confirmation str: the string the user has to enter in order to
confirm their action.
"""
if not confirmation:
confirmation = 'yes'
prompt = ('This action cannot be undone! Type "%s" or pr... | [
"def",
"no_going_back",
"(",
"confirmation",
")",
":",
"if",
"not",
"confirmation",
":",
"confirmation",
"=",
"'yes'",
"prompt",
"=",
"(",
"'This action cannot be undone! Type \"%s\" or press Enter '",
"'to abort'",
"%",
"confirmation",
")",
"ans",
"=",
"click",
".",
... | Show a confirmation to a user.
:param confirmation str: the string the user has to enter in order to
confirm their action. | [
"Show",
"a",
"confirmation",
"to",
"a",
"user",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L209-L225 |
1,776 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | iter_to_table | def iter_to_table(value):
"""Convert raw API responses to response tables."""
if isinstance(value, list):
return _format_list(value)
if isinstance(value, dict):
return _format_dict(value)
return value | python | def iter_to_table(value):
"""Convert raw API responses to response tables."""
if isinstance(value, list):
return _format_list(value)
if isinstance(value, dict):
return _format_dict(value)
return value | [
"def",
"iter_to_table",
"(",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"return",
"_format_list",
"(",
"value",
")",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"return",
"_format_dict",
"(",
"value",
")",
... | Convert raw API responses to response tables. | [
"Convert",
"raw",
"API",
"responses",
"to",
"response",
"tables",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L390-L396 |
1,777 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | _format_dict | def _format_dict(result):
"""Format dictionary responses into key-value table."""
table = KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
for key, value in result.items():
value = iter_to_table(value)
table.add_row([key, value])
return tab... | python | def _format_dict(result):
"""Format dictionary responses into key-value table."""
table = KeyValueTable(['name', 'value'])
table.align['name'] = 'r'
table.align['value'] = 'l'
for key, value in result.items():
value = iter_to_table(value)
table.add_row([key, value])
return tab... | [
"def",
"_format_dict",
"(",
"result",
")",
":",
"table",
"=",
"KeyValueTable",
"(",
"[",
"'name'",
",",
"'value'",
"]",
")",
"table",
".",
"align",
"[",
"'name'",
"]",
"=",
"'r'",
"table",
".",
"align",
"[",
"'value'",
"]",
"=",
"'l'",
"for",
"key",
... | Format dictionary responses into key-value table. | [
"Format",
"dictionary",
"responses",
"into",
"key",
"-",
"value",
"table",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L399-L410 |
1,778 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | _format_list | def _format_list(result):
"""Format list responses into a table."""
if not result:
return result
if isinstance(result[0], dict):
return _format_list_objects(result)
table = Table(['value'])
for item in result:
table.add_row([iter_to_table(item)])
return table | python | def _format_list(result):
"""Format list responses into a table."""
if not result:
return result
if isinstance(result[0], dict):
return _format_list_objects(result)
table = Table(['value'])
for item in result:
table.add_row([iter_to_table(item)])
return table | [
"def",
"_format_list",
"(",
"result",
")",
":",
"if",
"not",
"result",
":",
"return",
"result",
"if",
"isinstance",
"(",
"result",
"[",
"0",
"]",
",",
"dict",
")",
":",
"return",
"_format_list_objects",
"(",
"result",
")",
"table",
"=",
"Table",
"(",
"... | Format list responses into a table. | [
"Format",
"list",
"responses",
"into",
"a",
"table",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L413-L425 |
1,779 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | _format_list_objects | def _format_list_objects(result):
"""Format list of objects into a table."""
all_keys = set()
for item in result:
all_keys = all_keys.union(item.keys())
all_keys = sorted(all_keys)
table = Table(all_keys)
for item in result:
values = []
for key in all_keys:
... | python | def _format_list_objects(result):
"""Format list of objects into a table."""
all_keys = set()
for item in result:
all_keys = all_keys.union(item.keys())
all_keys = sorted(all_keys)
table = Table(all_keys)
for item in result:
values = []
for key in all_keys:
... | [
"def",
"_format_list_objects",
"(",
"result",
")",
":",
"all_keys",
"=",
"set",
"(",
")",
"for",
"item",
"in",
"result",
":",
"all_keys",
"=",
"all_keys",
".",
"union",
"(",
"item",
".",
"keys",
"(",
")",
")",
"all_keys",
"=",
"sorted",
"(",
"all_keys"... | Format list of objects into a table. | [
"Format",
"list",
"of",
"objects",
"into",
"a",
"table",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L428-L446 |
1,780 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | Table.to_python | def to_python(self):
"""Decode this Table object to standard Python types."""
# Adding rows
items = []
for row in self.rows:
formatted_row = [_format_python_value(v) for v in row]
items.append(dict(zip(self.columns, formatted_row)))
return items | python | def to_python(self):
"""Decode this Table object to standard Python types."""
# Adding rows
items = []
for row in self.rows:
formatted_row = [_format_python_value(v) for v in row]
items.append(dict(zip(self.columns, formatted_row)))
return items | [
"def",
"to_python",
"(",
"self",
")",
":",
"# Adding rows",
"items",
"=",
"[",
"]",
"for",
"row",
"in",
"self",
".",
"rows",
":",
"formatted_row",
"=",
"[",
"_format_python_value",
"(",
"v",
")",
"for",
"v",
"in",
"row",
"]",
"items",
".",
"append",
... | Decode this Table object to standard Python types. | [
"Decode",
"this",
"Table",
"object",
"to",
"standard",
"Python",
"types",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L285-L292 |
1,781 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | Table.prettytable | def prettytable(self):
"""Returns a new prettytable instance."""
table = prettytable.PrettyTable(self.columns)
if self.sortby:
if self.sortby in self.columns:
table.sortby = self.sortby
else:
msg = "Column (%s) doesn't exist to sort by" % ... | python | def prettytable(self):
"""Returns a new prettytable instance."""
table = prettytable.PrettyTable(self.columns)
if self.sortby:
if self.sortby in self.columns:
table.sortby = self.sortby
else:
msg = "Column (%s) doesn't exist to sort by" % ... | [
"def",
"prettytable",
"(",
"self",
")",
":",
"table",
"=",
"prettytable",
".",
"PrettyTable",
"(",
"self",
".",
"columns",
")",
"if",
"self",
".",
"sortby",
":",
"if",
"self",
".",
"sortby",
"in",
"self",
".",
"columns",
":",
"table",
".",
"sortby",
... | Returns a new prettytable instance. | [
"Returns",
"a",
"new",
"prettytable",
"instance",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L294-L312 |
1,782 | softlayer/softlayer-python | SoftLayer/CLI/formatting.py | KeyValueTable.to_python | def to_python(self):
"""Decode this KeyValueTable object to standard Python types."""
mapping = {}
for row in self.rows:
mapping[row[0]] = _format_python_value(row[1])
return mapping | python | def to_python(self):
"""Decode this KeyValueTable object to standard Python types."""
mapping = {}
for row in self.rows:
mapping[row[0]] = _format_python_value(row[1])
return mapping | [
"def",
"to_python",
"(",
"self",
")",
":",
"mapping",
"=",
"{",
"}",
"for",
"row",
"in",
"self",
".",
"rows",
":",
"mapping",
"[",
"row",
"[",
"0",
"]",
"]",
"=",
"_format_python_value",
"(",
"row",
"[",
"1",
"]",
")",
"return",
"mapping"
] | Decode this KeyValueTable object to standard Python types. | [
"Decode",
"this",
"KeyValueTable",
"object",
"to",
"standard",
"Python",
"types",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/formatting.py#L318-L323 |
1,783 | softlayer/softlayer-python | SoftLayer/CLI/user/create.py | cli | def cli(env, username, email, password, from_user, template, api_key):
"""Creates a user Users.
:Example: slcli user create my@email.com -e my@email.com -p generate -a
-t '{"firstName": "Test", "lastName": "Testerson"}'
Remember to set the permissions and access for this new user.
"""
mgr = S... | python | def cli(env, username, email, password, from_user, template, api_key):
"""Creates a user Users.
:Example: slcli user create my@email.com -e my@email.com -p generate -a
-t '{"firstName": "Test", "lastName": "Testerson"}'
Remember to set the permissions and access for this new user.
"""
mgr = S... | [
"def",
"cli",
"(",
"env",
",",
"username",
",",
"email",
",",
"password",
",",
"from_user",
",",
"template",
",",
"api_key",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"UserManager",
"(",
"env",
".",
"client",
")",
"user_mask",
"=",
"(",
"\"mask[id, firstNa... | Creates a user Users.
:Example: slcli user create my@email.com -e my@email.com -p generate -a
-t '{"firstName": "Test", "lastName": "Testerson"}'
Remember to set the permissions and access for this new user. | [
"Creates",
"a",
"user",
"Users",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/create.py#L34-L88 |
1,784 | softlayer/softlayer-python | SoftLayer/CLI/user/create.py | generate_password | def generate_password():
"""Returns a 23 character random string, with 3 special characters at the end"""
if sys.version_info > (3, 6):
import secrets # pylint: disable=import-error
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in rang... | python | def generate_password():
"""Returns a 23 character random string, with 3 special characters at the end"""
if sys.version_info > (3, 6):
import secrets # pylint: disable=import-error
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in rang... | [
"def",
"generate_password",
"(",
")",
":",
"if",
"sys",
".",
"version_info",
">",
"(",
"3",
",",
"6",
")",
":",
"import",
"secrets",
"# pylint: disable=import-error",
"alphabet",
"=",
"string",
".",
"ascii_letters",
"+",
"string",
".",
"digits",
"password",
... | Returns a 23 character random string, with 3 special characters at the end | [
"Returns",
"a",
"23",
"character",
"random",
"string",
"with",
"3",
"special",
"characters",
"at",
"the",
"end"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/create.py#L91-L100 |
1,785 | softlayer/softlayer-python | SoftLayer/CLI/event_log/types.py | cli | def cli(env):
"""Get Event Log Types"""
mgr = SoftLayer.EventLogManager(env.client)
event_log_types = mgr.get_event_log_types()
table = formatting.Table(COLUMNS)
for event_log_type in event_log_types:
table.add_row([event_log_type])
env.fout(table) | python | def cli(env):
"""Get Event Log Types"""
mgr = SoftLayer.EventLogManager(env.client)
event_log_types = mgr.get_event_log_types()
table = formatting.Table(COLUMNS)
for event_log_type in event_log_types:
table.add_row([event_log_type])
env.fout(table) | [
"def",
"cli",
"(",
"env",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"EventLogManager",
"(",
"env",
".",
"client",
")",
"event_log_types",
"=",
"mgr",
".",
"get_event_log_types",
"(",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"COLUMNS",
")",
"for"... | Get Event Log Types | [
"Get",
"Event",
"Log",
"Types"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/event_log/types.py#L15-L26 |
1,786 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_extra_price_id | def _get_extra_price_id(items, key_name, hourly, location):
"""Returns a price id attached to item with the given key_name."""
for item in items:
if utils.lookup(item, 'keyName') != key_name:
continue
for price in item['prices']:
if not _matches_billing(price, hourly):
... | python | def _get_extra_price_id(items, key_name, hourly, location):
"""Returns a price id attached to item with the given key_name."""
for item in items:
if utils.lookup(item, 'keyName') != key_name:
continue
for price in item['prices']:
if not _matches_billing(price, hourly):
... | [
"def",
"_get_extra_price_id",
"(",
"items",
",",
"key_name",
",",
"hourly",
",",
"location",
")",
":",
"for",
"item",
"in",
"items",
":",
"if",
"utils",
".",
"lookup",
"(",
"item",
",",
"'keyName'",
")",
"!=",
"key_name",
":",
"continue",
"for",
"price",... | Returns a price id attached to item with the given key_name. | [
"Returns",
"a",
"price",
"id",
"attached",
"to",
"item",
"with",
"the",
"given",
"key_name",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L668-L685 |
1,787 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_default_price_id | def _get_default_price_id(items, option, hourly, location):
"""Returns a 'free' price id given an option."""
for item in items:
if utils.lookup(item, 'itemCategory', 'categoryCode') != option:
continue
for price in item['prices']:
if all([float(price.get('hourlyRecurrin... | python | def _get_default_price_id(items, option, hourly, location):
"""Returns a 'free' price id given an option."""
for item in items:
if utils.lookup(item, 'itemCategory', 'categoryCode') != option:
continue
for price in item['prices']:
if all([float(price.get('hourlyRecurrin... | [
"def",
"_get_default_price_id",
"(",
"items",
",",
"option",
",",
"hourly",
",",
"location",
")",
":",
"for",
"item",
"in",
"items",
":",
"if",
"utils",
".",
"lookup",
"(",
"item",
",",
"'itemCategory'",
",",
"'categoryCode'",
")",
"!=",
"option",
":",
"... | Returns a 'free' price id given an option. | [
"Returns",
"a",
"free",
"price",
"id",
"given",
"an",
"option",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L688-L703 |
1,788 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_bandwidth_price_id | def _get_bandwidth_price_id(items,
hourly=True,
no_public=False,
location=None):
"""Choose a valid price id for bandwidth."""
# Prefer pay-for-use data transfer with hourly
for item in items:
capacity = float(item.... | python | def _get_bandwidth_price_id(items,
hourly=True,
no_public=False,
location=None):
"""Choose a valid price id for bandwidth."""
# Prefer pay-for-use data transfer with hourly
for item in items:
capacity = float(item.... | [
"def",
"_get_bandwidth_price_id",
"(",
"items",
",",
"hourly",
"=",
"True",
",",
"no_public",
"=",
"False",
",",
"location",
"=",
"None",
")",
":",
"# Prefer pay-for-use data transfer with hourly",
"for",
"item",
"in",
"items",
":",
"capacity",
"=",
"float",
"("... | Choose a valid price id for bandwidth. | [
"Choose",
"a",
"valid",
"price",
"id",
"for",
"bandwidth",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L706-L733 |
1,789 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_os_price_id | def _get_os_price_id(items, os, location):
"""Returns the price id matching."""
for item in items:
if any([utils.lookup(item,
'itemCategory',
'categoryCode') != 'os',
utils.lookup(item,
'softwareDescr... | python | def _get_os_price_id(items, os, location):
"""Returns the price id matching."""
for item in items:
if any([utils.lookup(item,
'itemCategory',
'categoryCode') != 'os',
utils.lookup(item,
'softwareDescr... | [
"def",
"_get_os_price_id",
"(",
"items",
",",
"os",
",",
"location",
")",
":",
"for",
"item",
"in",
"items",
":",
"if",
"any",
"(",
"[",
"utils",
".",
"lookup",
"(",
"item",
",",
"'itemCategory'",
",",
"'categoryCode'",
")",
"!=",
"'os'",
",",
"utils",... | Returns the price id matching. | [
"Returns",
"the",
"price",
"id",
"matching",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L736-L755 |
1,790 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_port_speed_price_id | def _get_port_speed_price_id(items, port_speed, no_public, location):
"""Choose a valid price id for port speed."""
for item in items:
if utils.lookup(item,
'itemCategory',
'categoryCode') != 'port_speed':
continue
# Check for correct... | python | def _get_port_speed_price_id(items, port_speed, no_public, location):
"""Choose a valid price id for port speed."""
for item in items:
if utils.lookup(item,
'itemCategory',
'categoryCode') != 'port_speed':
continue
# Check for correct... | [
"def",
"_get_port_speed_price_id",
"(",
"items",
",",
"port_speed",
",",
"no_public",
",",
"location",
")",
":",
"for",
"item",
"in",
"items",
":",
"if",
"utils",
".",
"lookup",
"(",
"item",
",",
"'itemCategory'",
",",
"'categoryCode'",
")",
"!=",
"'port_spe... | Choose a valid price id for port speed. | [
"Choose",
"a",
"valid",
"price",
"id",
"for",
"port",
"speed",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L758-L780 |
1,791 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _matches_location | def _matches_location(price, location):
"""Return True if the price object matches the location."""
# the price has no location restriction
if not price.get('locationGroupId'):
return True
# Check to see if any of the location groups match the location group
# of this price object
for g... | python | def _matches_location(price, location):
"""Return True if the price object matches the location."""
# the price has no location restriction
if not price.get('locationGroupId'):
return True
# Check to see if any of the location groups match the location group
# of this price object
for g... | [
"def",
"_matches_location",
"(",
"price",
",",
"location",
")",
":",
"# the price has no location restriction",
"if",
"not",
"price",
".",
"get",
"(",
"'locationGroupId'",
")",
":",
"return",
"True",
"# Check to see if any of the location groups match the location group",
"... | Return True if the price object matches the location. | [
"Return",
"True",
"if",
"the",
"price",
"object",
"matches",
"the",
"location",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L789-L801 |
1,792 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_location | def _get_location(package, location):
"""Get the longer key with a short location name."""
for region in package['regions']:
if region['location']['location']['name'] == location:
return region
raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'" % location) | python | def _get_location(package, location):
"""Get the longer key with a short location name."""
for region in package['regions']:
if region['location']['location']['name'] == location:
return region
raise SoftLayer.SoftLayerError("Could not find valid location for: '%s'" % location) | [
"def",
"_get_location",
"(",
"package",
",",
"location",
")",
":",
"for",
"region",
"in",
"package",
"[",
"'regions'",
"]",
":",
"if",
"region",
"[",
"'location'",
"]",
"[",
"'location'",
"]",
"[",
"'name'",
"]",
"==",
"location",
":",
"return",
"region"... | Get the longer key with a short location name. | [
"Get",
"the",
"longer",
"key",
"with",
"a",
"short",
"location",
"name",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L822-L828 |
1,793 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | _get_preset_id | def _get_preset_id(package, size):
"""Get the preset id given the keyName of the preset."""
for preset in package['activePresets'] + package['accountRestrictedActivePresets']:
if preset['keyName'] == size or preset['id'] == size:
return preset['id']
raise SoftLayer.SoftLayerError("Could... | python | def _get_preset_id(package, size):
"""Get the preset id given the keyName of the preset."""
for preset in package['activePresets'] + package['accountRestrictedActivePresets']:
if preset['keyName'] == size or preset['id'] == size:
return preset['id']
raise SoftLayer.SoftLayerError("Could... | [
"def",
"_get_preset_id",
"(",
"package",
",",
"size",
")",
":",
"for",
"preset",
"in",
"package",
"[",
"'activePresets'",
"]",
"+",
"package",
"[",
"'accountRestrictedActivePresets'",
"]",
":",
"if",
"preset",
"[",
"'keyName'",
"]",
"==",
"size",
"or",
"pres... | Get the preset id given the keyName of the preset. | [
"Get",
"the",
"preset",
"id",
"given",
"the",
"keyName",
"of",
"the",
"preset",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L831-L837 |
1,794 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | HardwareManager.cancel_hardware | def cancel_hardware(self, hardware_id, reason='unneeded', comment='', immediate=False):
"""Cancels the specified dedicated server.
Example::
# Cancels hardware id 1234
result = mgr.cancel_hardware(hardware_id=1234)
:param int hardware_id: The ID of the hardware to be c... | python | def cancel_hardware(self, hardware_id, reason='unneeded', comment='', immediate=False):
"""Cancels the specified dedicated server.
Example::
# Cancels hardware id 1234
result = mgr.cancel_hardware(hardware_id=1234)
:param int hardware_id: The ID of the hardware to be c... | [
"def",
"cancel_hardware",
"(",
"self",
",",
"hardware_id",
",",
"reason",
"=",
"'unneeded'",
",",
"comment",
"=",
"''",
",",
"immediate",
"=",
"False",
")",
":",
"# Get cancel reason",
"reasons",
"=",
"self",
".",
"get_cancellation_reasons",
"(",
")",
"cancel_... | Cancels the specified dedicated server.
Example::
# Cancels hardware id 1234
result = mgr.cancel_hardware(hardware_id=1234)
:param int hardware_id: The ID of the hardware to be cancelled.
:param string reason: The reason code for the cancellation. This should come from... | [
"Cancels",
"the",
"specified",
"dedicated",
"server",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L61-L112 |
1,795 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | HardwareManager.get_hardware | def get_hardware(self, hardware_id, **kwargs):
"""Get details about a hardware device.
:param integer id: the hardware ID
:returns: A dictionary containing a large amount of information about
the specified server.
Example::
object_mask = "mask[id,networkV... | python | def get_hardware(self, hardware_id, **kwargs):
"""Get details about a hardware device.
:param integer id: the hardware ID
:returns: A dictionary containing a large amount of information about
the specified server.
Example::
object_mask = "mask[id,networkV... | [
"def",
"get_hardware",
"(",
"self",
",",
"hardware_id",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'mask'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'mask'",
"]",
"=",
"(",
"'id,'",
"'globalIdentifier,'",
"'fullyQualifiedDomainName,'",
"'hostname,'",
"'domai... | Get details about a hardware device.
:param integer id: the hardware ID
:returns: A dictionary containing a large amount of information about
the specified server.
Example::
object_mask = "mask[id,networkVlans[vlanNumber]]"
# Object masks are optional... | [
"Get",
"details",
"about",
"a",
"hardware",
"device",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L204-L265 |
1,796 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | HardwareManager.reload | def reload(self, hardware_id, post_uri=None, ssh_keys=None):
"""Perform an OS reload of a server with its current configuration.
:param integer hardware_id: the instance ID to reload
:param string post_uri: The URI of the post-install script to run
after reload
... | python | def reload(self, hardware_id, post_uri=None, ssh_keys=None):
"""Perform an OS reload of a server with its current configuration.
:param integer hardware_id: the instance ID to reload
:param string post_uri: The URI of the post-install script to run
after reload
... | [
"def",
"reload",
"(",
"self",
",",
"hardware_id",
",",
"post_uri",
"=",
"None",
",",
"ssh_keys",
"=",
"None",
")",
":",
"config",
"=",
"{",
"}",
"if",
"post_uri",
":",
"config",
"[",
"'customProvisionScriptUri'",
"]",
"=",
"post_uri",
"if",
"ssh_keys",
"... | Perform an OS reload of a server with its current configuration.
:param integer hardware_id: the instance ID to reload
:param string post_uri: The URI of the post-install script to run
after reload
:param list ssh_keys: The SSH keys to add to the root user | [
"Perform",
"an",
"OS",
"reload",
"of",
"a",
"server",
"with",
"its",
"current",
"configuration",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L267-L285 |
1,797 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | HardwareManager.change_port_speed | def change_port_speed(self, hardware_id, public, speed):
"""Allows you to change the port speed of a server's NICs.
:param int hardware_id: The ID of the server
:param bool public: Flag to indicate which interface to change.
True (default) means the public interface.... | python | def change_port_speed(self, hardware_id, public, speed):
"""Allows you to change the port speed of a server's NICs.
:param int hardware_id: The ID of the server
:param bool public: Flag to indicate which interface to change.
True (default) means the public interface.... | [
"def",
"change_port_speed",
"(",
"self",
",",
"hardware_id",
",",
"public",
",",
"speed",
")",
":",
"if",
"public",
":",
"return",
"self",
".",
"client",
".",
"call",
"(",
"'Hardware_Server'",
",",
"'setPublicNetworkInterfaceSpeed'",
",",
"speed",
",",
"id",
... | Allows you to change the port speed of a server's NICs.
:param int hardware_id: The ID of the server
:param bool public: Flag to indicate which interface to change.
True (default) means the public interface.
False indicates the private interface.
... | [
"Allows",
"you",
"to",
"change",
"the",
"port",
"speed",
"of",
"a",
"server",
"s",
"NICs",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L298-L324 |
1,798 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | HardwareManager.place_order | def place_order(self, **kwargs):
"""Places an order for a piece of hardware.
See get_create_options() for valid arguments.
:param string size: server size name or presetId
:param string hostname: server hostname
:param string domain: server domain name
:param string loc... | python | def place_order(self, **kwargs):
"""Places an order for a piece of hardware.
See get_create_options() for valid arguments.
:param string size: server size name or presetId
:param string hostname: server hostname
:param string domain: server domain name
:param string loc... | [
"def",
"place_order",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"create_options",
"=",
"self",
".",
"_generate_create_dict",
"(",
"*",
"*",
"kwargs",
")",
"return",
"self",
".",
"client",
"[",
"'Product_Order'",
"]",
".",
"placeOrder",
"(",
"create_o... | Places an order for a piece of hardware.
See get_create_options() for valid arguments.
:param string size: server size name or presetId
:param string hostname: server hostname
:param string domain: server domain name
:param string location: location (datacenter) name
:p... | [
"Places",
"an",
"order",
"for",
"a",
"piece",
"of",
"hardware",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L326-L347 |
1,799 | softlayer/softlayer-python | SoftLayer/managers/hardware.py | HardwareManager.verify_order | def verify_order(self, **kwargs):
"""Verifies an order for a piece of hardware.
See :func:`place_order` for a list of available options.
"""
create_options = self._generate_create_dict(**kwargs)
return self.client['Product_Order'].verifyOrder(create_options) | python | def verify_order(self, **kwargs):
"""Verifies an order for a piece of hardware.
See :func:`place_order` for a list of available options.
"""
create_options = self._generate_create_dict(**kwargs)
return self.client['Product_Order'].verifyOrder(create_options) | [
"def",
"verify_order",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"create_options",
"=",
"self",
".",
"_generate_create_dict",
"(",
"*",
"*",
"kwargs",
")",
"return",
"self",
".",
"client",
"[",
"'Product_Order'",
"]",
".",
"verifyOrder",
"(",
"create... | Verifies an order for a piece of hardware.
See :func:`place_order` for a list of available options. | [
"Verifies",
"an",
"order",
"for",
"a",
"piece",
"of",
"hardware",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/hardware.py#L349-L355 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.