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,600 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.get_vlan | def get_vlan(self, vlan_id):
"""Returns information about a single VLAN.
:param int id: The unique identifier for the VLAN
:returns: A dictionary containing a large amount of information about
the specified VLAN.
"""
return self.vlan.getObject(id=vlan_id, mask... | python | def get_vlan(self, vlan_id):
"""Returns information about a single VLAN.
:param int id: The unique identifier for the VLAN
:returns: A dictionary containing a large amount of information about
the specified VLAN.
"""
return self.vlan.getObject(id=vlan_id, mask... | [
"def",
"get_vlan",
"(",
"self",
",",
"vlan_id",
")",
":",
"return",
"self",
".",
"vlan",
".",
"getObject",
"(",
"id",
"=",
"vlan_id",
",",
"mask",
"=",
"DEFAULT_GET_VLAN_MASK",
")"
] | Returns information about a single VLAN.
:param int id: The unique identifier for the VLAN
:returns: A dictionary containing a large amount of information about
the specified VLAN. | [
"Returns",
"information",
"about",
"a",
"single",
"VLAN",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L403-L411 |
1,601 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.list_global_ips | def list_global_ips(self, version=None, identifier=None, **kwargs):
"""Returns a list of all global IP address records on the account.
:param int version: Only returns IPs of this version (4 or 6)
:param string identifier: If specified, the list will only contain the
... | python | def list_global_ips(self, version=None, identifier=None, **kwargs):
"""Returns a list of all global IP address records on the account.
:param int version: Only returns IPs of this version (4 or 6)
:param string identifier: If specified, the list will only contain the
... | [
"def",
"list_global_ips",
"(",
"self",
",",
"version",
"=",
"None",
",",
"identifier",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'mask'",
"not",
"in",
"kwargs",
":",
"mask",
"=",
"[",
"'destinationIpAddress[hardware, virtualGuest]'",
",",
"'ipAd... | Returns a list of all global IP address records on the account.
:param int version: Only returns IPs of this version (4 or 6)
:param string identifier: If specified, the list will only contain the
global ips matching this network identifier. | [
"Returns",
"a",
"list",
"of",
"all",
"global",
"IP",
"address",
"records",
"on",
"the",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L413-L436 |
1,602 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.list_subnets | def list_subnets(self, identifier=None, datacenter=None, version=0,
subnet_type=None, network_space=None, **kwargs):
"""Display a list of all subnets on the account.
This provides a quick overview of all subnets including information
about data center residence and the numb... | python | def list_subnets(self, identifier=None, datacenter=None, version=0,
subnet_type=None, network_space=None, **kwargs):
"""Display a list of all subnets on the account.
This provides a quick overview of all subnets including information
about data center residence and the numb... | [
"def",
"list_subnets",
"(",
"self",
",",
"identifier",
"=",
"None",
",",
"datacenter",
"=",
"None",
",",
"version",
"=",
"0",
",",
"subnet_type",
"=",
"None",
",",
"network_space",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'mask'",
"not",
... | Display a list of all subnets on the account.
This provides a quick overview of all subnets including information
about data center residence and the number of devices attached.
:param string identifier: If specified, the list will only contain the
subnet ma... | [
"Display",
"a",
"list",
"of",
"all",
"subnets",
"on",
"the",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L438-L480 |
1,603 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.list_vlans | def list_vlans(self, datacenter=None, vlan_number=None, name=None, **kwargs):
"""Display a list of all VLANs on the account.
This provides a quick overview of all VLANs including information about
data center residence and the number of devices attached.
:param string datacenter: If sp... | python | def list_vlans(self, datacenter=None, vlan_number=None, name=None, **kwargs):
"""Display a list of all VLANs on the account.
This provides a quick overview of all VLANs including information about
data center residence and the number of devices attached.
:param string datacenter: If sp... | [
"def",
"list_vlans",
"(",
"self",
",",
"datacenter",
"=",
"None",
",",
"vlan_number",
"=",
"None",
",",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"kwargs",
".",
"get",
"(",
"'filter'",
")... | Display a list of all VLANs on the account.
This provides a quick overview of all VLANs including information about
data center residence and the number of devices attached.
:param string datacenter: If specified, the list will only contain
VLANs in the spec... | [
"Display",
"a",
"list",
"of",
"all",
"VLANs",
"on",
"the",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L482-L516 |
1,604 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.list_securitygroup_rules | def list_securitygroup_rules(self, group_id):
"""List security group rules associated with a security group.
:param int group_id: The security group to list rules for
"""
return self.security_group.getRules(id=group_id, iter=True) | python | def list_securitygroup_rules(self, group_id):
"""List security group rules associated with a security group.
:param int group_id: The security group to list rules for
"""
return self.security_group.getRules(id=group_id, iter=True) | [
"def",
"list_securitygroup_rules",
"(",
"self",
",",
"group_id",
")",
":",
"return",
"self",
".",
"security_group",
".",
"getRules",
"(",
"id",
"=",
"group_id",
",",
"iter",
"=",
"True",
")"
] | List security group rules associated with a security group.
:param int group_id: The security group to list rules for | [
"List",
"security",
"group",
"rules",
"associated",
"with",
"a",
"security",
"group",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L523-L528 |
1,605 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.remove_securitygroup_rules | def remove_securitygroup_rules(self, group_id, rules):
"""Remove rules from a security group.
:param int group_id: The ID of the security group
:param list rules: The list of IDs to remove
"""
return self.security_group.removeRules(rules, id=group_id) | python | def remove_securitygroup_rules(self, group_id, rules):
"""Remove rules from a security group.
:param int group_id: The ID of the security group
:param list rules: The list of IDs to remove
"""
return self.security_group.removeRules(rules, id=group_id) | [
"def",
"remove_securitygroup_rules",
"(",
"self",
",",
"group_id",
",",
"rules",
")",
":",
"return",
"self",
".",
"security_group",
".",
"removeRules",
"(",
"rules",
",",
"id",
"=",
"group_id",
")"
] | Remove rules from a security group.
:param int group_id: The ID of the security group
:param list rules: The list of IDs to remove | [
"Remove",
"rules",
"from",
"a",
"security",
"group",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L538-L544 |
1,606 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.get_event_logs_by_request_id | def get_event_logs_by_request_id(self, request_id):
"""Gets all event logs by the given request id
:param string request_id: The request id we want to filter on
"""
# Get all relevant event logs
unfiltered_logs = self._get_cci_event_logs() + self._get_security_group_event_logs(... | python | def get_event_logs_by_request_id(self, request_id):
"""Gets all event logs by the given request id
:param string request_id: The request id we want to filter on
"""
# Get all relevant event logs
unfiltered_logs = self._get_cci_event_logs() + self._get_security_group_event_logs(... | [
"def",
"get_event_logs_by_request_id",
"(",
"self",
",",
"request_id",
")",
":",
"# Get all relevant event logs",
"unfiltered_logs",
"=",
"self",
".",
"_get_cci_event_logs",
"(",
")",
"+",
"self",
".",
"_get_security_group_event_logs",
"(",
")",
"# Grab only those that ha... | Gets all event logs by the given request id
:param string request_id: The request id we want to filter on | [
"Gets",
"all",
"event",
"logs",
"by",
"the",
"given",
"request",
"id"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L546-L567 |
1,607 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager.summary_by_datacenter | def summary_by_datacenter(self):
"""Summary of the networks on the account, grouped by data center.
The resultant dictionary is primarily useful for statistical purposes.
It contains count information rather than raw data. If you want raw
information, see the :func:`list_vlans` method i... | python | def summary_by_datacenter(self):
"""Summary of the networks on the account, grouped by data center.
The resultant dictionary is primarily useful for statistical purposes.
It contains count information rather than raw data. If you want raw
information, see the :func:`list_vlans` method i... | [
"def",
"summary_by_datacenter",
"(",
"self",
")",
":",
"datacenters",
"=",
"collections",
".",
"defaultdict",
"(",
"lambda",
":",
"{",
"'hardware_count'",
":",
"0",
",",
"'public_ip_count'",
":",
"0",
",",
"'subnet_count'",
":",
"0",
",",
"'virtual_guest_count'"... | Summary of the networks on the account, grouped by data center.
The resultant dictionary is primarily useful for statistical purposes.
It contains count information rather than raw data. If you want raw
information, see the :func:`list_vlans` method instead.
:returns: A dictionary keye... | [
"Summary",
"of",
"the",
"networks",
"on",
"the",
"account",
"grouped",
"by",
"data",
"center",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L599-L634 |
1,608 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager._list_global_ips_by_identifier | def _list_global_ips_by_identifier(self, identifier):
"""Returns a list of IDs of the global IP matching the identifier.
:param string identifier: The identifier to look up
:returns: List of matching IDs
"""
results = self.list_global_ips(identifier=identifier, mask='id')
... | python | def _list_global_ips_by_identifier(self, identifier):
"""Returns a list of IDs of the global IP matching the identifier.
:param string identifier: The identifier to look up
:returns: List of matching IDs
"""
results = self.list_global_ips(identifier=identifier, mask='id')
... | [
"def",
"_list_global_ips_by_identifier",
"(",
"self",
",",
"identifier",
")",
":",
"results",
"=",
"self",
".",
"list_global_ips",
"(",
"identifier",
"=",
"identifier",
",",
"mask",
"=",
"'id'",
")",
"return",
"[",
"result",
"[",
"'id'",
"]",
"for",
"result"... | Returns a list of IDs of the global IP matching the identifier.
:param string identifier: The identifier to look up
:returns: List of matching IDs | [
"Returns",
"a",
"list",
"of",
"IDs",
"of",
"the",
"global",
"IP",
"matching",
"the",
"identifier",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L644-L651 |
1,609 | softlayer/softlayer-python | SoftLayer/managers/network.py | NetworkManager._list_subnets_by_identifier | def _list_subnets_by_identifier(self, identifier):
"""Returns a list of IDs of the subnet matching the identifier.
:param string identifier: The identifier to look up
:returns: List of matching IDs
"""
identifier = identifier.split('/', 1)[0]
results = self.list_subnets... | python | def _list_subnets_by_identifier(self, identifier):
"""Returns a list of IDs of the subnet matching the identifier.
:param string identifier: The identifier to look up
:returns: List of matching IDs
"""
identifier = identifier.split('/', 1)[0]
results = self.list_subnets... | [
"def",
"_list_subnets_by_identifier",
"(",
"self",
",",
"identifier",
")",
":",
"identifier",
"=",
"identifier",
".",
"split",
"(",
"'/'",
",",
"1",
")",
"[",
"0",
"]",
"results",
"=",
"self",
".",
"list_subnets",
"(",
"identifier",
"=",
"identifier",
",",... | Returns a list of IDs of the subnet matching the identifier.
:param string identifier: The identifier to look up
:returns: List of matching IDs | [
"Returns",
"a",
"list",
"of",
"IDs",
"of",
"the",
"subnet",
"matching",
"the",
"identifier",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L653-L662 |
1,610 | softlayer/softlayer-python | SoftLayer/CLI/file/replication/partners.py | cli | def cli(env, columns, sortby, volume_id):
"""List existing replicant volumes for a file volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
legal_volumes = file_storage_manager.get_replication_partners(
volume_id
)
if not legal_volumes:
click.echo("There are ... | python | def cli(env, columns, sortby, volume_id):
"""List existing replicant volumes for a file volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
legal_volumes = file_storage_manager.get_replication_partners(
volume_id
)
if not legal_volumes:
click.echo("There are ... | [
"def",
"cli",
"(",
"env",
",",
"columns",
",",
"sortby",
",",
"volume_id",
")",
":",
"file_storage_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"legal_volumes",
"=",
"file_storage_manager",
".",
"get_replication_partners",... | List existing replicant volumes for a file volume. | [
"List",
"existing",
"replicant",
"volumes",
"for",
"a",
"file",
"volume",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/replication/partners.py#L42-L60 |
1,611 | softlayer/softlayer-python | SoftLayer/CLI/ticket/__init__.py | get_ticket_results | def get_ticket_results(mgr, ticket_id, update_count=1):
"""Get output about a ticket.
:param integer id: the ticket ID
:param integer update_count: number of entries to retrieve from ticket
:returns: a KeyValue table containing the details of the ticket
"""
ticket = mgr.get_ticket(ticket_id)
... | python | def get_ticket_results(mgr, ticket_id, update_count=1):
"""Get output about a ticket.
:param integer id: the ticket ID
:param integer update_count: number of entries to retrieve from ticket
:returns: a KeyValue table containing the details of the ticket
"""
ticket = mgr.get_ticket(ticket_id)
... | [
"def",
"get_ticket_results",
"(",
"mgr",
",",
"ticket_id",
",",
"update_count",
"=",
"1",
")",
":",
"ticket",
"=",
"mgr",
".",
"get_ticket",
"(",
"ticket_id",
")",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",
"[",
"'name'",
",",
"'value'",
"]",
... | Get output about a ticket.
:param integer id: the ticket ID
:param integer update_count: number of entries to retrieve from ticket
:returns: a KeyValue table containing the details of the ticket | [
"Get",
"output",
"about",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/__init__.py#L20-L68 |
1,612 | softlayer/softlayer-python | SoftLayer/CLI/subnet/create.py | cli | def cli(env, network, quantity, vlan_id, ipv6, test):
"""Add a new subnet to your account. Valid quantities vary by type.
\b
Type - Valid Quantities (IPv4)
public - 4, 8, 16, 32
private - 4, 8, 16, 32, 64
\b
Type - Valid Quantities (IPv6)
public - 64
"""
mgr = SoftLayer.Ne... | python | def cli(env, network, quantity, vlan_id, ipv6, test):
"""Add a new subnet to your account. Valid quantities vary by type.
\b
Type - Valid Quantities (IPv4)
public - 4, 8, 16, 32
private - 4, 8, 16, 32, 64
\b
Type - Valid Quantities (IPv6)
public - 64
"""
mgr = SoftLayer.Ne... | [
"def",
"cli",
"(",
"env",
",",
"network",
",",
"quantity",
",",
"vlan_id",
",",
"ipv6",
",",
"test",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"if",
"not",
"(",
"test",
"or",
"env",
".",
"skip_confirmat... | Add a new subnet to your account. Valid quantities vary by type.
\b
Type - Valid Quantities (IPv4)
public - 4, 8, 16, 32
private - 4, 8, 16, 32, 64
\b
Type - Valid Quantities (IPv6)
public - 64 | [
"Add",
"a",
"new",
"subnet",
"to",
"your",
"account",
".",
"Valid",
"quantities",
"vary",
"by",
"type",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/create.py#L21-L63 |
1,613 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.list_tickets | def list_tickets(self, open_status=True, closed_status=True):
"""List all tickets.
:param boolean open_status: include open tickets
:param boolean closed_status: include closed tickets
"""
mask = """mask[id, title, assignedUser[firstName, lastName], priority,
c... | python | def list_tickets(self, open_status=True, closed_status=True):
"""List all tickets.
:param boolean open_status: include open tickets
:param boolean closed_status: include closed tickets
"""
mask = """mask[id, title, assignedUser[firstName, lastName], priority,
c... | [
"def",
"list_tickets",
"(",
"self",
",",
"open_status",
"=",
"True",
",",
"closed_status",
"=",
"True",
")",
":",
"mask",
"=",
"\"\"\"mask[id, title, assignedUser[firstName, lastName], priority,\n createDate, lastEditDate, accountId, status, updateCount]\"\"\"",
"c... | List all tickets.
:param boolean open_status: include open tickets
:param boolean closed_status: include closed tickets | [
"List",
"all",
"tickets",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L25-L43 |
1,614 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.create_ticket | def create_ticket(self, title=None, body=None, subject=None, priority=None):
"""Create a new ticket.
:param string title: title for the new ticket
:param string body: body for the new ticket
:param integer subject: id of the subject to be assigned to the ticket
:param integer pr... | python | def create_ticket(self, title=None, body=None, subject=None, priority=None):
"""Create a new ticket.
:param string title: title for the new ticket
:param string body: body for the new ticket
:param integer subject: id of the subject to be assigned to the ticket
:param integer pr... | [
"def",
"create_ticket",
"(",
"self",
",",
"title",
"=",
"None",
",",
"body",
"=",
"None",
",",
"subject",
"=",
"None",
",",
"priority",
"=",
"None",
")",
":",
"current_user",
"=",
"self",
".",
"account",
".",
"getCurrentUser",
"(",
")",
"new_ticket",
"... | Create a new ticket.
:param string title: title for the new ticket
:param string body: body for the new ticket
:param integer subject: id of the subject to be assigned to the ticket
:param integer priority: Value from 1 (highest) to 4 (lowest) | [
"Create",
"a",
"new",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L60-L79 |
1,615 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.update_ticket | def update_ticket(self, ticket_id=None, body=None):
"""Update a ticket.
:param integer ticket_id: the id of the ticket to update
:param string body: entry to update in the ticket
"""
return self.ticket.addUpdate({'entry': body}, id=ticket_id) | python | def update_ticket(self, ticket_id=None, body=None):
"""Update a ticket.
:param integer ticket_id: the id of the ticket to update
:param string body: entry to update in the ticket
"""
return self.ticket.addUpdate({'entry': body}, id=ticket_id) | [
"def",
"update_ticket",
"(",
"self",
",",
"ticket_id",
"=",
"None",
",",
"body",
"=",
"None",
")",
":",
"return",
"self",
".",
"ticket",
".",
"addUpdate",
"(",
"{",
"'entry'",
":",
"body",
"}",
",",
"id",
"=",
"ticket_id",
")"
] | Update a ticket.
:param integer ticket_id: the id of the ticket to update
:param string body: entry to update in the ticket | [
"Update",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L81-L87 |
1,616 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.upload_attachment | def upload_attachment(self, ticket_id=None, file_path=None, file_name=None):
"""Upload an attachment to a ticket.
:param integer ticket_id: the id of the ticket to upload the attachment to
:param string file_path: The path of the attachment to be uploaded
:param string file_name: The na... | python | def upload_attachment(self, ticket_id=None, file_path=None, file_name=None):
"""Upload an attachment to a ticket.
:param integer ticket_id: the id of the ticket to upload the attachment to
:param string file_path: The path of the attachment to be uploaded
:param string file_name: The na... | [
"def",
"upload_attachment",
"(",
"self",
",",
"ticket_id",
"=",
"None",
",",
"file_path",
"=",
"None",
",",
"file_name",
"=",
"None",
")",
":",
"file_content",
"=",
"None",
"with",
"open",
"(",
"file_path",
",",
"'rb'",
")",
"as",
"attached_file",
":",
"... | Upload an attachment to a ticket.
:param integer ticket_id: the id of the ticket to upload the attachment to
:param string file_path: The path of the attachment to be uploaded
:param string file_name: The name of the attachment shown in the ticket
:returns: dict -- The uploaded attachme... | [
"Upload",
"an",
"attachment",
"to",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L89-L106 |
1,617 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.attach_hardware | def attach_hardware(self, ticket_id=None, hardware_id=None):
"""Attach hardware to a ticket.
:param integer ticket_id: the id of the ticket to attach to
:param integer hardware_id: the id of the hardware to attach
:returns: dict -- The new ticket attachment
"""
return s... | python | def attach_hardware(self, ticket_id=None, hardware_id=None):
"""Attach hardware to a ticket.
:param integer ticket_id: the id of the ticket to attach to
:param integer hardware_id: the id of the hardware to attach
:returns: dict -- The new ticket attachment
"""
return s... | [
"def",
"attach_hardware",
"(",
"self",
",",
"ticket_id",
"=",
"None",
",",
"hardware_id",
"=",
"None",
")",
":",
"return",
"self",
".",
"ticket",
".",
"addAttachedHardware",
"(",
"hardware_id",
",",
"id",
"=",
"ticket_id",
")"
] | Attach hardware to a ticket.
:param integer ticket_id: the id of the ticket to attach to
:param integer hardware_id: the id of the hardware to attach
:returns: dict -- The new ticket attachment | [
"Attach",
"hardware",
"to",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L108-L116 |
1,618 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.attach_virtual_server | def attach_virtual_server(self, ticket_id=None, virtual_id=None):
"""Attach a virtual server to a ticket.
:param integer ticket_id: the id of the ticket to attach to
:param integer virtual_id: the id of the virtual server to attach
:returns: dict -- The new ticket attachment
""... | python | def attach_virtual_server(self, ticket_id=None, virtual_id=None):
"""Attach a virtual server to a ticket.
:param integer ticket_id: the id of the ticket to attach to
:param integer virtual_id: the id of the virtual server to attach
:returns: dict -- The new ticket attachment
""... | [
"def",
"attach_virtual_server",
"(",
"self",
",",
"ticket_id",
"=",
"None",
",",
"virtual_id",
"=",
"None",
")",
":",
"return",
"self",
".",
"ticket",
".",
"addAttachedVirtualGuest",
"(",
"virtual_id",
",",
"id",
"=",
"ticket_id",
")"
] | Attach a virtual server to a ticket.
:param integer ticket_id: the id of the ticket to attach to
:param integer virtual_id: the id of the virtual server to attach
:returns: dict -- The new ticket attachment | [
"Attach",
"a",
"virtual",
"server",
"to",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L118-L126 |
1,619 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.detach_hardware | def detach_hardware(self, ticket_id=None, hardware_id=None):
"""Detach hardware from a ticket.
:param ticket_id: the id of the ticket to detach from
:param hardware_id: the id of the hardware to detach
:returns: bool -- Whether the detachment was successful
"""
return s... | python | def detach_hardware(self, ticket_id=None, hardware_id=None):
"""Detach hardware from a ticket.
:param ticket_id: the id of the ticket to detach from
:param hardware_id: the id of the hardware to detach
:returns: bool -- Whether the detachment was successful
"""
return s... | [
"def",
"detach_hardware",
"(",
"self",
",",
"ticket_id",
"=",
"None",
",",
"hardware_id",
"=",
"None",
")",
":",
"return",
"self",
".",
"ticket",
".",
"removeAttachedHardware",
"(",
"hardware_id",
",",
"id",
"=",
"ticket_id",
")"
] | Detach hardware from a ticket.
:param ticket_id: the id of the ticket to detach from
:param hardware_id: the id of the hardware to detach
:returns: bool -- Whether the detachment was successful | [
"Detach",
"hardware",
"from",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L128-L136 |
1,620 | softlayer/softlayer-python | SoftLayer/managers/ticket.py | TicketManager.detach_virtual_server | def detach_virtual_server(self, ticket_id=None, virtual_id=None):
"""Detach a virtual server from a ticket.
:param ticket_id: the id of the ticket to detach from
:param virtual_id: the id of the virtual server to detach
:returns: bool -- Whether the detachment was successful
""... | python | def detach_virtual_server(self, ticket_id=None, virtual_id=None):
"""Detach a virtual server from a ticket.
:param ticket_id: the id of the ticket to detach from
:param virtual_id: the id of the virtual server to detach
:returns: bool -- Whether the detachment was successful
""... | [
"def",
"detach_virtual_server",
"(",
"self",
",",
"ticket_id",
"=",
"None",
",",
"virtual_id",
"=",
"None",
")",
":",
"return",
"self",
".",
"ticket",
".",
"removeAttachedVirtualGuest",
"(",
"virtual_id",
",",
"id",
"=",
"ticket_id",
")"
] | Detach a virtual server from a ticket.
:param ticket_id: the id of the ticket to detach from
:param virtual_id: the id of the virtual server to detach
:returns: bool -- Whether the detachment was successful | [
"Detach",
"a",
"virtual",
"server",
"from",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L138-L146 |
1,621 | softlayer/softlayer-python | SoftLayer/CLI/subnet/detail.py | cli | def cli(env, identifier, no_vs, no_hardware):
"""Get subnet details."""
mgr = SoftLayer.NetworkManager(env.client)
subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier,
name='subnet')
subnet = mgr.get_subnet(subnet_id)
table = formatting.KeyValueTabl... | python | def cli(env, identifier, no_vs, no_hardware):
"""Get subnet details."""
mgr = SoftLayer.NetworkManager(env.client)
subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier,
name='subnet')
subnet = mgr.get_subnet(subnet_id)
table = formatting.KeyValueTabl... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"no_vs",
",",
"no_hardware",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"subnet_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_subnet_ids",
... | Get subnet details. | [
"Get",
"subnet",
"details",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/detail.py#L22-L72 |
1,622 | softlayer/softlayer-python | SoftLayer/CLI/dns/zone_import.py | cli | def cli(env, zonefile, dry_run):
"""Import zone based off a BIND zone file."""
manager = SoftLayer.DNSManager(env.client)
with open(zonefile) as zone_f:
zone_contents = zone_f.read()
zone, records, bad_lines = parse_zone_details(zone_contents)
env.out("Parsed: zone=%s" % zone)
for rec... | python | def cli(env, zonefile, dry_run):
"""Import zone based off a BIND zone file."""
manager = SoftLayer.DNSManager(env.client)
with open(zonefile) as zone_f:
zone_contents = zone_f.read()
zone, records, bad_lines = parse_zone_details(zone_contents)
env.out("Parsed: zone=%s" % zone)
for rec... | [
"def",
"cli",
"(",
"env",
",",
"zonefile",
",",
"dry_run",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"DNSManager",
"(",
"env",
".",
"client",
")",
"with",
"open",
"(",
"zonefile",
")",
"as",
"zone_f",
":",
"zone_contents",
"=",
"zone_f",
".",
"read",... | Import zone based off a BIND zone file. | [
"Import",
"zone",
"based",
"off",
"a",
"BIND",
"zone",
"file",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/zone_import.py#L25-L68 |
1,623 | softlayer/softlayer-python | SoftLayer/CLI/dns/zone_import.py | parse_zone_details | def parse_zone_details(zone_contents):
"""Parses a zone file into python data-structures."""
records = []
bad_lines = []
zone_lines = [line.strip() for line in zone_contents.split('\n')]
zone_search = re.search(r'^\$ORIGIN (?P<zone>.*)\.', zone_lines[0])
zone = zone_search.group('zone')
fo... | python | def parse_zone_details(zone_contents):
"""Parses a zone file into python data-structures."""
records = []
bad_lines = []
zone_lines = [line.strip() for line in zone_contents.split('\n')]
zone_search = re.search(r'^\$ORIGIN (?P<zone>.*)\.', zone_lines[0])
zone = zone_search.group('zone')
fo... | [
"def",
"parse_zone_details",
"(",
"zone_contents",
")",
":",
"records",
"=",
"[",
"]",
"bad_lines",
"=",
"[",
"]",
"zone_lines",
"=",
"[",
"line",
".",
"strip",
"(",
")",
"for",
"line",
"in",
"zone_contents",
".",
"split",
"(",
"'\\n'",
")",
"]",
"zone... | Parses a zone file into python data-structures. | [
"Parses",
"a",
"zone",
"file",
"into",
"python",
"data",
"-",
"structures",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/zone_import.py#L71-L117 |
1,624 | softlayer/softlayer-python | SoftLayer/CLI/object_storage/list_accounts.py | cli | def cli(env):
"""List object storage accounts."""
mgr = SoftLayer.ObjectStorageManager(env.client)
accounts = mgr.list_accounts()
table = formatting.Table(['id', 'name', 'apiType'])
table.sortby = 'id'
api_type = None
for account in accounts:
if 'vendorName' in account and account['... | python | def cli(env):
"""List object storage accounts."""
mgr = SoftLayer.ObjectStorageManager(env.client)
accounts = mgr.list_accounts()
table = formatting.Table(['id', 'name', 'apiType'])
table.sortby = 'id'
api_type = None
for account in accounts:
if 'vendorName' in account and account['... | [
"def",
"cli",
"(",
"env",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"ObjectStorageManager",
"(",
"env",
".",
"client",
")",
"accounts",
"=",
"mgr",
".",
"list_accounts",
"(",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'name'",... | List object storage accounts. | [
"List",
"object",
"storage",
"accounts",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/object_storage/list_accounts.py#L13-L33 |
1,625 | softlayer/softlayer-python | SoftLayer/CLI/dns/zone_create.py | cli | def cli(env, zone):
"""Create a zone."""
manager = SoftLayer.DNSManager(env.client)
manager.create_zone(zone) | python | def cli(env, zone):
"""Create a zone."""
manager = SoftLayer.DNSManager(env.client)
manager.create_zone(zone) | [
"def",
"cli",
"(",
"env",
",",
"zone",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"DNSManager",
"(",
"env",
".",
"client",
")",
"manager",
".",
"create_zone",
"(",
"zone",
")"
] | Create a zone. | [
"Create",
"a",
"zone",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/zone_create.py#L13-L17 |
1,626 | softlayer/softlayer-python | SoftLayer/CLI/loadbal/create.py | cli | def cli(env, billing_id, datacenter):
"""Adds a load balancer given the id returned from create-options."""
mgr = SoftLayer.LoadBalancerManager(env.client)
if not formatting.confirm("This action will incur charges on your "
"account. Continue?"):
raise exceptions.CLIAb... | python | def cli(env, billing_id, datacenter):
"""Adds a load balancer given the id returned from create-options."""
mgr = SoftLayer.LoadBalancerManager(env.client)
if not formatting.confirm("This action will incur charges on your "
"account. Continue?"):
raise exceptions.CLIAb... | [
"def",
"cli",
"(",
"env",
",",
"billing_id",
",",
"datacenter",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"LoadBalancerManager",
"(",
"env",
".",
"client",
")",
"if",
"not",
"formatting",
".",
"confirm",
"(",
"\"This action will incur charges on your \"",
"\"accou... | Adds a load balancer given the id returned from create-options. | [
"Adds",
"a",
"load",
"balancer",
"given",
"the",
"id",
"returned",
"from",
"create",
"-",
"options",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/create.py#L17-L25 |
1,627 | softlayer/softlayer-python | SoftLayer/CLI/loadbal/group_reset.py | cli | def cli(env, identifier):
"""Reset connections on a certain service group."""
mgr = SoftLayer.LoadBalancerManager(env.client)
loadbal_id, group_id = loadbal.parse_id(identifier)
mgr.reset_service_group(loadbal_id, group_id)
env.fout('Load balancer service group connections are being reset!') | python | def cli(env, identifier):
"""Reset connections on a certain service group."""
mgr = SoftLayer.LoadBalancerManager(env.client)
loadbal_id, group_id = loadbal.parse_id(identifier)
mgr.reset_service_group(loadbal_id, group_id)
env.fout('Load balancer service group connections are being reset!') | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"LoadBalancerManager",
"(",
"env",
".",
"client",
")",
"loadbal_id",
",",
"group_id",
"=",
"loadbal",
".",
"parse_id",
"(",
"identifier",
")",
"mgr",
".",
"reset_service_g... | Reset connections on a certain service group. | [
"Reset",
"connections",
"on",
"a",
"certain",
"service",
"group",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/group_reset.py#L14-L21 |
1,628 | softlayer/softlayer-python | SoftLayer/CLI/ticket/upload.py | cli | def cli(env, identifier, path, name):
"""Adds an attachment to an existing ticket."""
mgr = SoftLayer.TicketManager(env.client)
ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket')
if path is None:
raise exceptions.ArgumentError("Missing argument --path")
if not os.path.e... | python | def cli(env, identifier, path, name):
"""Adds an attachment to an existing ticket."""
mgr = SoftLayer.TicketManager(env.client)
ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket')
if path is None:
raise exceptions.ArgumentError("Missing argument --path")
if not os.path.e... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"path",
",",
"name",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"TicketManager",
"(",
"env",
".",
"client",
")",
"ticket_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"identi... | Adds an attachment to an existing ticket. | [
"Adds",
"an",
"attachment",
"to",
"an",
"existing",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/upload.py#L19-L37 |
1,629 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | has_firewall | def has_firewall(vlan):
"""Helper to determine whether or not a VLAN has a firewall.
:param dict vlan: A dictionary representing a VLAN
:returns: True if the VLAN has a firewall, false if it doesn't.
"""
return bool(
vlan.get('dedicatedFirewallFlag', None) or
vlan.get('highAvailabil... | python | def has_firewall(vlan):
"""Helper to determine whether or not a VLAN has a firewall.
:param dict vlan: A dictionary representing a VLAN
:returns: True if the VLAN has a firewall, false if it doesn't.
"""
return bool(
vlan.get('dedicatedFirewallFlag', None) or
vlan.get('highAvailabil... | [
"def",
"has_firewall",
"(",
"vlan",
")",
":",
"return",
"bool",
"(",
"vlan",
".",
"get",
"(",
"'dedicatedFirewallFlag'",
",",
"None",
")",
"or",
"vlan",
".",
"get",
"(",
"'highAvailabilityFirewallFlag'",
",",
"None",
")",
"or",
"vlan",
".",
"get",
"(",
"... | Helper to determine whether or not a VLAN has a firewall.
:param dict vlan: A dictionary representing a VLAN
:returns: True if the VLAN has a firewall, false if it doesn't. | [
"Helper",
"to",
"determine",
"whether",
"or",
"not",
"a",
"VLAN",
"has",
"a",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L17-L29 |
1,630 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.get_standard_package | def get_standard_package(self, server_id, is_virt=True):
"""Retrieves the standard firewall package for the virtual server.
:param int server_id: The ID of the server to create the firewall for
:param bool is_virt: True if the ID provided is for a virtual server,
Fa... | python | def get_standard_package(self, server_id, is_virt=True):
"""Retrieves the standard firewall package for the virtual server.
:param int server_id: The ID of the server to create the firewall for
:param bool is_virt: True if the ID provided is for a virtual server,
Fa... | [
"def",
"get_standard_package",
"(",
"self",
",",
"server_id",
",",
"is_virt",
"=",
"True",
")",
":",
"firewall_port_speed",
"=",
"self",
".",
"_get_fwl_port_speed",
"(",
"server_id",
",",
"is_virt",
")",
"_value",
"=",
"\"%s%s\"",
"%",
"(",
"firewall_port_speed"... | Retrieves the standard firewall package for the virtual server.
:param int server_id: The ID of the server to create the firewall for
:param bool is_virt: True if the ID provided is for a virtual server,
False for a server
:returns: A dictionary containing the stand... | [
"Retrieves",
"the",
"standard",
"firewall",
"package",
"for",
"the",
"virtual",
"server",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L46-L61 |
1,631 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.get_dedicated_package | def get_dedicated_package(self, ha_enabled=False):
"""Retrieves the dedicated firewall package.
:param bool ha_enabled: True if HA is to be enabled on the firewall
False for No HA
:returns: A dictionary containing the dedicated virtual server firewall
... | python | def get_dedicated_package(self, ha_enabled=False):
"""Retrieves the dedicated firewall package.
:param bool ha_enabled: True if HA is to be enabled on the firewall
False for No HA
:returns: A dictionary containing the dedicated virtual server firewall
... | [
"def",
"get_dedicated_package",
"(",
"self",
",",
"ha_enabled",
"=",
"False",
")",
":",
"fwl_filter",
"=",
"'Hardware Firewall (Dedicated)'",
"ha_fwl_filter",
"=",
"'Hardware Firewall (High Availability)'",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"{",
"}",
")... | Retrieves the dedicated firewall package.
:param bool ha_enabled: True if HA is to be enabled on the firewall
False for No HA
:returns: A dictionary containing the dedicated virtual server firewall
package | [
"Retrieves",
"the",
"dedicated",
"firewall",
"package",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L63-L80 |
1,632 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.cancel_firewall | def cancel_firewall(self, firewall_id, dedicated=False):
"""Cancels the specified firewall.
:param int firewall_id: Firewall ID to be cancelled.
:param bool dedicated: If true, the firewall instance is dedicated,
otherwise, the firewall instance is shared.
... | python | def cancel_firewall(self, firewall_id, dedicated=False):
"""Cancels the specified firewall.
:param int firewall_id: Firewall ID to be cancelled.
:param bool dedicated: If true, the firewall instance is dedicated,
otherwise, the firewall instance is shared.
... | [
"def",
"cancel_firewall",
"(",
"self",
",",
"firewall_id",
",",
"dedicated",
"=",
"False",
")",
":",
"fwl_billing",
"=",
"self",
".",
"_get_fwl_billing_item",
"(",
"firewall_id",
",",
"dedicated",
")",
"billing_item_service",
"=",
"self",
".",
"client",
"[",
"... | Cancels the specified firewall.
:param int firewall_id: Firewall ID to be cancelled.
:param bool dedicated: If true, the firewall instance is dedicated,
otherwise, the firewall instance is shared. | [
"Cancels",
"the",
"specified",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L82-L92 |
1,633 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.add_vlan_firewall | def add_vlan_firewall(self, vlan_id, ha_enabled=False):
"""Creates a firewall for the specified vlan.
:param int vlan_id: The ID of the vlan to create the firewall for
:param bool ha_enabled: If True, an HA firewall will be created
:returns: A dictionary containing the VLAN firewall or... | python | def add_vlan_firewall(self, vlan_id, ha_enabled=False):
"""Creates a firewall for the specified vlan.
:param int vlan_id: The ID of the vlan to create the firewall for
:param bool ha_enabled: If True, an HA firewall will be created
:returns: A dictionary containing the VLAN firewall or... | [
"def",
"add_vlan_firewall",
"(",
"self",
",",
"vlan_id",
",",
"ha_enabled",
"=",
"False",
")",
":",
"package",
"=",
"self",
".",
"get_dedicated_package",
"(",
"ha_enabled",
")",
"product_order",
"=",
"{",
"'complexType'",
":",
"'SoftLayer_Container_Product_Order_Net... | Creates a firewall for the specified vlan.
:param int vlan_id: The ID of the vlan to create the firewall for
:param bool ha_enabled: If True, an HA firewall will be created
:returns: A dictionary containing the VLAN firewall order | [
"Creates",
"a",
"firewall",
"for",
"the",
"specified",
"vlan",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L125-L143 |
1,634 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager._get_fwl_billing_item | def _get_fwl_billing_item(self, firewall_id, dedicated=False):
"""Retrieves the billing item of the firewall.
:param int firewall_id: Firewall ID to get the billing item for
:param bool dedicated: whether the firewall is dedicated or standard
:returns: A dictionary of the firewall billi... | python | def _get_fwl_billing_item(self, firewall_id, dedicated=False):
"""Retrieves the billing item of the firewall.
:param int firewall_id: Firewall ID to get the billing item for
:param bool dedicated: whether the firewall is dedicated or standard
:returns: A dictionary of the firewall billi... | [
"def",
"_get_fwl_billing_item",
"(",
"self",
",",
"firewall_id",
",",
"dedicated",
"=",
"False",
")",
":",
"mask",
"=",
"'mask[id,billingItem[id]]'",
"if",
"dedicated",
":",
"firewall_service",
"=",
"self",
".",
"client",
"[",
"'Network_Vlan_Firewall'",
"]",
"else... | Retrieves the billing item of the firewall.
:param int firewall_id: Firewall ID to get the billing item for
:param bool dedicated: whether the firewall is dedicated or standard
:returns: A dictionary of the firewall billing item. | [
"Retrieves",
"the",
"billing",
"item",
"of",
"the",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L145-L166 |
1,635 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager._get_fwl_port_speed | def _get_fwl_port_speed(self, server_id, is_virt=True):
"""Determines the appropriate speed for a firewall.
:param int server_id: The ID of server the firewall is for
:param bool is_virt: True if the server_id is for a virtual server
:returns: a integer representing the Mbps speed of a ... | python | def _get_fwl_port_speed(self, server_id, is_virt=True):
"""Determines the appropriate speed for a firewall.
:param int server_id: The ID of server the firewall is for
:param bool is_virt: True if the server_id is for a virtual server
:returns: a integer representing the Mbps speed of a ... | [
"def",
"_get_fwl_port_speed",
"(",
"self",
",",
"server_id",
",",
"is_virt",
"=",
"True",
")",
":",
"fwl_port_speed",
"=",
"0",
"if",
"is_virt",
":",
"mask",
"=",
"(",
"'primaryNetworkComponent[maxSpeed]'",
")",
"svc",
"=",
"self",
".",
"client",
"[",
"'Virt... | Determines the appropriate speed for a firewall.
:param int server_id: The ID of server the firewall is for
:param bool is_virt: True if the server_id is for a virtual server
:returns: a integer representing the Mbps speed of a firewall | [
"Determines",
"the",
"appropriate",
"speed",
"for",
"a",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L168-L212 |
1,636 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.get_firewalls | def get_firewalls(self):
"""Returns a list of all firewalls on the account.
:returns: A list of firewalls on the current account.
"""
mask = ('firewallNetworkComponents,'
'networkVlanFirewall,'
'dedicatedFirewallFlag,'
'firewallGuestNetwo... | python | def get_firewalls(self):
"""Returns a list of all firewalls on the account.
:returns: A list of firewalls on the current account.
"""
mask = ('firewallNetworkComponents,'
'networkVlanFirewall,'
'dedicatedFirewallFlag,'
'firewallGuestNetwo... | [
"def",
"get_firewalls",
"(",
"self",
")",
":",
"mask",
"=",
"(",
"'firewallNetworkComponents,'",
"'networkVlanFirewall,'",
"'dedicatedFirewallFlag,'",
"'firewallGuestNetworkComponents,'",
"'firewallInterfaces,'",
"'firewallRules,'",
"'highAvailabilityFirewallFlag'",
")",
"return",
... | Returns a list of all firewalls on the account.
:returns: A list of firewalls on the current account. | [
"Returns",
"a",
"list",
"of",
"all",
"firewalls",
"on",
"the",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L214-L230 |
1,637 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.get_standard_fwl_rules | def get_standard_fwl_rules(self, firewall_id):
"""Get the rules of a standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:returns: A list of the rules.
"""
svc = self.client['Network_Component_Firewall']
return svc.getRules(id=firewal... | python | def get_standard_fwl_rules(self, firewall_id):
"""Get the rules of a standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:returns: A list of the rules.
"""
svc = self.client['Network_Component_Firewall']
return svc.getRules(id=firewal... | [
"def",
"get_standard_fwl_rules",
"(",
"self",
",",
"firewall_id",
")",
":",
"svc",
"=",
"self",
".",
"client",
"[",
"'Network_Component_Firewall'",
"]",
"return",
"svc",
".",
"getRules",
"(",
"id",
"=",
"firewall_id",
",",
"mask",
"=",
"RULE_MASK",
")"
] | Get the rules of a standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:returns: A list of the rules. | [
"Get",
"the",
"rules",
"of",
"a",
"standard",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L232-L240 |
1,638 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.edit_dedicated_fwl_rules | def edit_dedicated_fwl_rules(self, firewall_id, rules):
"""Edit the rules for dedicated firewall.
:param integer firewall_id: the instance ID of the dedicated firewall
:param list rules: the rules to be pushed on the firewall as defined by
SoftLayer_Network_Firewall_U... | python | def edit_dedicated_fwl_rules(self, firewall_id, rules):
"""Edit the rules for dedicated firewall.
:param integer firewall_id: the instance ID of the dedicated firewall
:param list rules: the rules to be pushed on the firewall as defined by
SoftLayer_Network_Firewall_U... | [
"def",
"edit_dedicated_fwl_rules",
"(",
"self",
",",
"firewall_id",
",",
"rules",
")",
":",
"mask",
"=",
"(",
"'mask[networkVlan[firewallInterfaces'",
"'[firewallContextAccessControlLists]]]'",
")",
"svc",
"=",
"self",
".",
"client",
"[",
"'Network_Vlan_Firewall'",
"]",... | Edit the rules for dedicated firewall.
:param integer firewall_id: the instance ID of the dedicated firewall
:param list rules: the rules to be pushed on the firewall as defined by
SoftLayer_Network_Firewall_Update_Request_Rule | [
"Edit",
"the",
"rules",
"for",
"dedicated",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L252-L279 |
1,639 | softlayer/softlayer-python | SoftLayer/managers/firewall.py | FirewallManager.edit_standard_fwl_rules | def edit_standard_fwl_rules(self, firewall_id, rules):
"""Edit the rules for standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:param dict rules: the rules to be pushed on the firewall
"""
rule_svc = self.client['Network_Firewall_Update_Req... | python | def edit_standard_fwl_rules(self, firewall_id, rules):
"""Edit the rules for standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:param dict rules: the rules to be pushed on the firewall
"""
rule_svc = self.client['Network_Firewall_Update_Req... | [
"def",
"edit_standard_fwl_rules",
"(",
"self",
",",
"firewall_id",
",",
"rules",
")",
":",
"rule_svc",
"=",
"self",
".",
"client",
"[",
"'Network_Firewall_Update_Request'",
"]",
"template",
"=",
"{",
"'networkComponentFirewallId'",
":",
"firewall_id",
",",
"'rules'"... | Edit the rules for standard firewall.
:param integer firewall_id: the instance ID of the standard firewall
:param dict rules: the rules to be pushed on the firewall | [
"Edit",
"the",
"rules",
"for",
"standard",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L281-L291 |
1,640 | softlayer/softlayer-python | SoftLayer/CLI/image/edit.py | cli | def cli(env, identifier, name, note, tag):
"""Edit details of an image."""
image_mgr = SoftLayer.ImageManager(env.client)
data = {}
if name:
data['name'] = name
if note:
data['note'] = note
if tag:
data['tag'] = tag
image_id = helpers.resolve_id(image_mgr.resolve_ids... | python | def cli(env, identifier, name, note, tag):
"""Edit details of an image."""
image_mgr = SoftLayer.ImageManager(env.client)
data = {}
if name:
data['name'] = name
if note:
data['note'] = note
if tag:
data['tag'] = tag
image_id = helpers.resolve_id(image_mgr.resolve_ids... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"name",
",",
"note",
",",
"tag",
")",
":",
"image_mgr",
"=",
"SoftLayer",
".",
"ImageManager",
"(",
"env",
".",
"client",
")",
"data",
"=",
"{",
"}",
"if",
"name",
":",
"data",
"[",
"'name'",
"]",
... | Edit details of an image. | [
"Edit",
"details",
"of",
"an",
"image",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/edit.py#L18-L31 |
1,641 | softlayer/softlayer-python | SoftLayer/CLI/ticket/attach.py | cli | def cli(env, identifier, hardware_identifier, virtual_identifier):
"""Attach devices to a ticket."""
ticket_mgr = SoftLayer.TicketManager(env.client)
if hardware_identifier and virtual_identifier:
raise exceptions.ArgumentError("Cannot attach hardware and a virtual server at the same time")
if... | python | def cli(env, identifier, hardware_identifier, virtual_identifier):
"""Attach devices to a ticket."""
ticket_mgr = SoftLayer.TicketManager(env.client)
if hardware_identifier and virtual_identifier:
raise exceptions.ArgumentError("Cannot attach hardware and a virtual server at the same time")
if... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"hardware_identifier",
",",
"virtual_identifier",
")",
":",
"ticket_mgr",
"=",
"SoftLayer",
".",
"TicketManager",
"(",
"env",
".",
"client",
")",
"if",
"hardware_identifier",
"and",
"virtual_identifier",
":",
"ra... | Attach devices to a ticket. | [
"Attach",
"devices",
"to",
"a",
"ticket",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/attach.py#L19-L35 |
1,642 | softlayer/softlayer-python | SoftLayer/managers/metadata.py | MetadataManager.get | def get(self, name, param=None):
"""Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes
"""
if name not in self.attribs:
raise exceptions.SoftLayerError('Unknown met... | python | def get(self, name, param=None):
"""Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes
"""
if name not in self.attribs:
raise exceptions.SoftLayerError('Unknown met... | [
"def",
"get",
"(",
"self",
",",
"name",
",",
"param",
"=",
"None",
")",
":",
"if",
"name",
"not",
"in",
"self",
".",
"attribs",
":",
"raise",
"exceptions",
".",
"SoftLayerError",
"(",
"'Unknown metadata attribute.'",
")",
"call_details",
"=",
"self",
".",
... | Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes | [
"Retreive",
"a",
"metadata",
"attribute",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/metadata.py#L73-L100 |
1,643 | softlayer/softlayer-python | SoftLayer/managers/metadata.py | MetadataManager._get_network | def _get_network(self, kind, router=True, vlans=True, vlan_ids=True):
"""Wrapper for getting details about networks.
:param string kind: network kind. Typically 'public' or 'private'
:param boolean router: flag to include router information
:param boolean vlans: flag to incl... | python | def _get_network(self, kind, router=True, vlans=True, vlan_ids=True):
"""Wrapper for getting details about networks.
:param string kind: network kind. Typically 'public' or 'private'
:param boolean router: flag to include router information
:param boolean vlans: flag to incl... | [
"def",
"_get_network",
"(",
"self",
",",
"kind",
",",
"router",
"=",
"True",
",",
"vlans",
"=",
"True",
",",
"vlan_ids",
"=",
"True",
")",
":",
"network",
"=",
"{",
"}",
"macs",
"=",
"self",
".",
"get",
"(",
"'%s_mac'",
"%",
"kind",
")",
"network",... | Wrapper for getting details about networks.
:param string kind: network kind. Typically 'public' or 'private'
:param boolean router: flag to include router information
:param boolean vlans: flag to include vlan information
:param boolean vlan_ids: flag to include vlan_id... | [
"Wrapper",
"for",
"getting",
"details",
"about",
"networks",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/metadata.py#L102-L127 |
1,644 | softlayer/softlayer-python | SoftLayer/shell/cmd_env.py | cli | def cli(env):
"""Print environment variables."""
filtered_vars = dict([(k, v)
for k, v in env.vars.items()
if not k.startswith('_')])
env.fout(formatting.iter_to_table(filtered_vars)) | python | def cli(env):
"""Print environment variables."""
filtered_vars = dict([(k, v)
for k, v in env.vars.items()
if not k.startswith('_')])
env.fout(formatting.iter_to_table(filtered_vars)) | [
"def",
"cli",
"(",
"env",
")",
":",
"filtered_vars",
"=",
"dict",
"(",
"[",
"(",
"k",
",",
"v",
")",
"for",
"k",
",",
"v",
"in",
"env",
".",
"vars",
".",
"items",
"(",
")",
"if",
"not",
"k",
".",
"startswith",
"(",
"'_'",
")",
"]",
")",
"en... | Print environment variables. | [
"Print",
"environment",
"variables",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/shell/cmd_env.py#L12-L17 |
1,645 | softlayer/softlayer-python | SoftLayer/CLI/block/snapshot/restore.py | cli | def cli(env, volume_id, snapshot_id):
"""Restore block volume using a given snapshot"""
block_manager = SoftLayer.BlockStorageManager(env.client)
success = block_manager.restore_from_snapshot(volume_id, snapshot_id)
if success:
click.echo('Block volume %s is being restored using snapshot %s'
... | python | def cli(env, volume_id, snapshot_id):
"""Restore block volume using a given snapshot"""
block_manager = SoftLayer.BlockStorageManager(env.client)
success = block_manager.restore_from_snapshot(volume_id, snapshot_id)
if success:
click.echo('Block volume %s is being restored using snapshot %s'
... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"snapshot_id",
")",
":",
"block_manager",
"=",
"SoftLayer",
".",
"BlockStorageManager",
"(",
"env",
".",
"client",
")",
"success",
"=",
"block_manager",
".",
"restore_from_snapshot",
"(",
"volume_id",
",",
"snap... | Restore block volume using a given snapshot | [
"Restore",
"block",
"volume",
"using",
"a",
"given",
"snapshot"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/snapshot/restore.py#L15-L22 |
1,646 | softlayer/softlayer-python | SoftLayer/CLI/ssl/add.py | cli | def cli(env, crt, csr, icc, key, notes):
"""Add and upload SSL certificate details."""
template = {
'intermediateCertificate': '',
'certificateSigningRequest': '',
'notes': notes,
}
template['certificate'] = open(crt).read()
template['privateKey'] = open(key).read()
if c... | python | def cli(env, crt, csr, icc, key, notes):
"""Add and upload SSL certificate details."""
template = {
'intermediateCertificate': '',
'certificateSigningRequest': '',
'notes': notes,
}
template['certificate'] = open(crt).read()
template['privateKey'] = open(key).read()
if c... | [
"def",
"cli",
"(",
"env",
",",
"crt",
",",
"csr",
",",
"icc",
",",
"key",
",",
"notes",
")",
":",
"template",
"=",
"{",
"'intermediateCertificate'",
":",
"''",
",",
"'certificateSigningRequest'",
":",
"''",
",",
"'notes'",
":",
"notes",
",",
"}",
"temp... | Add and upload SSL certificate details. | [
"Add",
"and",
"upload",
"SSL",
"certificate",
"details",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/add.py#L23-L42 |
1,647 | softlayer/softlayer-python | SoftLayer/CLI/image/export.py | cli | def cli(env, identifier, uri, ibm_api_key):
"""Export an image to object storage.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage
... | python | def cli(env, identifier, uri, ibm_api_key):
"""Export an image to object storage.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage
... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"uri",
",",
"ibm_api_key",
")",
":",
"image_mgr",
"=",
"SoftLayer",
".",
"ImageManager",
"(",
"env",
".",
"client",
")",
"image_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"image_mgr",
".",
"resolve_ids",
... | Export an image to object storage.
The URI for an object storage object (.vhd/.iso file) of the format:
swift://<objectStorageAccount>@<cluster>/<container>/<objectPath>
or cos://<regionName>/<bucketName>/<objectPath> if using IBM Cloud
Object Storage | [
"Export",
"an",
"image",
"to",
"object",
"storage",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/export.py#L22-L36 |
1,648 | softlayer/softlayer-python | SoftLayer/CLI/virt/__init__.py | MemoryType.convert | def convert(self, value, param, ctx): # pylint: disable=inconsistent-return-statements
"""Validate memory argument. Returns the memory value in megabytes."""
matches = MEMORY_RE.match(value.lower())
if matches is None:
self.fail('%s is not a valid value for memory amount' % value, p... | python | def convert(self, value, param, ctx): # pylint: disable=inconsistent-return-statements
"""Validate memory argument. Returns the memory value in megabytes."""
matches = MEMORY_RE.match(value.lower())
if matches is None:
self.fail('%s is not a valid value for memory amount' % value, p... | [
"def",
"convert",
"(",
"self",
",",
"value",
",",
"param",
",",
"ctx",
")",
":",
"# pylint: disable=inconsistent-return-statements",
"matches",
"=",
"MEMORY_RE",
".",
"match",
"(",
"value",
".",
"lower",
"(",
")",
")",
"if",
"matches",
"is",
"None",
":",
"... | Validate memory argument. Returns the memory value in megabytes. | [
"Validate",
"memory",
"argument",
".",
"Returns",
"the",
"memory",
"value",
"in",
"megabytes",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/__init__.py#L15-L31 |
1,649 | softlayer/softlayer-python | SoftLayer/CLI/nas/credentials.py | cli | def cli(env, identifier):
"""List NAS account credentials."""
nw_mgr = SoftLayer.NetworkManager(env.client)
result = nw_mgr.get_nas_credentials(identifier)
table = formatting.Table(['username', 'password'])
table.add_row([result.get('username', 'None'),
result.get('password', 'No... | python | def cli(env, identifier):
"""List NAS account credentials."""
nw_mgr = SoftLayer.NetworkManager(env.client)
result = nw_mgr.get_nas_credentials(identifier)
table = formatting.Table(['username', 'password'])
table.add_row([result.get('username', 'None'),
result.get('password', 'No... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"nw_mgr",
"=",
"SoftLayer",
".",
"NetworkManager",
"(",
"env",
".",
"client",
")",
"result",
"=",
"nw_mgr",
".",
"get_nas_credentials",
"(",
"identifier",
")",
"table",
"=",
"formatting",
".",
"Table",... | List NAS account credentials. | [
"List",
"NAS",
"account",
"credentials",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/nas/credentials.py#L14-L22 |
1,650 | softlayer/softlayer-python | SoftLayer/CLI/firewall/detail.py | cli | def cli(env, identifier):
"""Detail firewall."""
mgr = SoftLayer.FirewallManager(env.client)
firewall_type, firewall_id = firewall.parse_id(identifier)
if firewall_type == 'vlan':
rules = mgr.get_dedicated_fwl_rules(firewall_id)
else:
rules = mgr.get_standard_fwl_rules(firewall_id)... | python | def cli(env, identifier):
"""Detail firewall."""
mgr = SoftLayer.FirewallManager(env.client)
firewall_type, firewall_id = firewall.parse_id(identifier)
if firewall_type == 'vlan':
rules = mgr.get_dedicated_fwl_rules(firewall_id)
else:
rules = mgr.get_standard_fwl_rules(firewall_id)... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"FirewallManager",
"(",
"env",
".",
"client",
")",
"firewall_type",
",",
"firewall_id",
"=",
"firewall",
".",
"parse_id",
"(",
"identifier",
")",
"if",
"firewall_type",
"=... | Detail firewall. | [
"Detail",
"firewall",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/detail.py#L16-L27 |
1,651 | softlayer/softlayer-python | SoftLayer/CLI/firewall/detail.py | get_rules_table | def get_rules_table(rules):
"""Helper to format the rules into a table.
:param list rules: A list containing the rules of the firewall
:returns: a formatted table of the firewall rules
"""
table = formatting.Table(['#', 'action', 'protocol', 'src_ip', 'src_mask',
'dest... | python | def get_rules_table(rules):
"""Helper to format the rules into a table.
:param list rules: A list containing the rules of the firewall
:returns: a formatted table of the firewall rules
"""
table = formatting.Table(['#', 'action', 'protocol', 'src_ip', 'src_mask',
'dest... | [
"def",
"get_rules_table",
"(",
"rules",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'#'",
",",
"'action'",
",",
"'protocol'",
",",
"'src_ip'",
",",
"'src_mask'",
",",
"'dest'",
",",
"'dest_mask'",
"]",
")",
"table",
".",
"sortby",
"=",... | Helper to format the rules into a table.
:param list rules: A list containing the rules of the firewall
:returns: a formatted table of the firewall rules | [
"Helper",
"to",
"format",
"the",
"rules",
"into",
"a",
"table",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/detail.py#L30-L50 |
1,652 | softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager.add_key | def add_key(self, key, label, notes=None):
"""Adds a new SSH key to the account.
:param string key: The SSH key to add
:param string label: The label for the key
:param string notes: Additional notes for the key
:returns: A dictionary of the new key's information.
"""
... | python | def add_key(self, key, label, notes=None):
"""Adds a new SSH key to the account.
:param string key: The SSH key to add
:param string label: The label for the key
:param string notes: Additional notes for the key
:returns: A dictionary of the new key's information.
"""
... | [
"def",
"add_key",
"(",
"self",
",",
"key",
",",
"label",
",",
"notes",
"=",
"None",
")",
":",
"order",
"=",
"{",
"'key'",
":",
"key",
",",
"'label'",
":",
"label",
",",
"'notes'",
":",
"notes",
",",
"}",
"return",
"self",
".",
"sshkey",
".",
"cre... | Adds a new SSH key to the account.
:param string key: The SSH key to add
:param string label: The label for the key
:param string notes: Additional notes for the key
:returns: A dictionary of the new key's information. | [
"Adds",
"a",
"new",
"SSH",
"key",
"to",
"the",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L26-L40 |
1,653 | softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager.edit_key | def edit_key(self, key_id, label=None, notes=None):
"""Edits information about an SSH key.
:param int key_id: The ID of the key to edit
:param string label: The new label for the key
:param string notes: Notes to set or change on the key
:returns: A Boolean indicating success or... | python | def edit_key(self, key_id, label=None, notes=None):
"""Edits information about an SSH key.
:param int key_id: The ID of the key to edit
:param string label: The new label for the key
:param string notes: Notes to set or change on the key
:returns: A Boolean indicating success or... | [
"def",
"edit_key",
"(",
"self",
",",
"key_id",
",",
"label",
"=",
"None",
",",
"notes",
"=",
"None",
")",
":",
"data",
"=",
"{",
"}",
"if",
"label",
":",
"data",
"[",
"'label'",
"]",
"=",
"label",
"if",
"notes",
":",
"data",
"[",
"'notes'",
"]",
... | Edits information about an SSH key.
:param int key_id: The ID of the key to edit
:param string label: The new label for the key
:param string notes: Notes to set or change on the key
:returns: A Boolean indicating success or failure | [
"Edits",
"information",
"about",
"an",
"SSH",
"key",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L50-L66 |
1,654 | softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager.list_keys | def list_keys(self, label=None):
"""Lists all SSH keys on the account.
:param string label: Filter list based on SSH key label
:returns: A list of dictionaries with information about each key
"""
_filter = utils.NestedDict({})
if label:
_filter['sshKeys']['la... | python | def list_keys(self, label=None):
"""Lists all SSH keys on the account.
:param string label: Filter list based on SSH key label
:returns: A list of dictionaries with information about each key
"""
_filter = utils.NestedDict({})
if label:
_filter['sshKeys']['la... | [
"def",
"list_keys",
"(",
"self",
",",
"label",
"=",
"None",
")",
":",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"{",
"}",
")",
"if",
"label",
":",
"_filter",
"[",
"'sshKeys'",
"]",
"[",
"'label'",
"]",
"=",
"utils",
".",
"query_filter",
"(",
... | Lists all SSH keys on the account.
:param string label: Filter list based on SSH key label
:returns: A list of dictionaries with information about each key | [
"Lists",
"all",
"SSH",
"keys",
"on",
"the",
"account",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L76-L86 |
1,655 | softlayer/softlayer-python | SoftLayer/managers/sshkey.py | SshKeyManager._get_ids_from_label | def _get_ids_from_label(self, label):
"""Return sshkey IDs which match the given label."""
keys = self.list_keys()
results = []
for key in keys:
if key['label'] == label:
results.append(key['id'])
return results | python | def _get_ids_from_label(self, label):
"""Return sshkey IDs which match the given label."""
keys = self.list_keys()
results = []
for key in keys:
if key['label'] == label:
results.append(key['id'])
return results | [
"def",
"_get_ids_from_label",
"(",
"self",
",",
"label",
")",
":",
"keys",
"=",
"self",
".",
"list_keys",
"(",
")",
"results",
"=",
"[",
"]",
"for",
"key",
"in",
"keys",
":",
"if",
"key",
"[",
"'label'",
"]",
"==",
"label",
":",
"results",
".",
"ap... | Return sshkey IDs which match the given label. | [
"Return",
"sshkey",
"IDs",
"which",
"match",
"the",
"given",
"label",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/sshkey.py#L88-L95 |
1,656 | softlayer/softlayer-python | SoftLayer/CLI/ssl/download.py | cli | def cli(env, identifier):
"""Download SSL certificate and key file."""
manager = SoftLayer.SSLManager(env.client)
certificate = manager.get_certificate(identifier)
write_cert(certificate['commonName'] + '.crt', certificate['certificate'])
write_cert(certificate['commonName'] + '.key', certificate[... | python | def cli(env, identifier):
"""Download SSL certificate and key file."""
manager = SoftLayer.SSLManager(env.client)
certificate = manager.get_certificate(identifier)
write_cert(certificate['commonName'] + '.crt', certificate['certificate'])
write_cert(certificate['commonName'] + '.key', certificate[... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"SSLManager",
"(",
"env",
".",
"client",
")",
"certificate",
"=",
"manager",
".",
"get_certificate",
"(",
"identifier",
")",
"write_cert",
"(",
"certificate",
"[",
"'c... | Download SSL certificate and key file. | [
"Download",
"SSL",
"certificate",
"and",
"key",
"file",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/download.py#L13-L28 |
1,657 | softlayer/softlayer-python | SoftLayer/CLI/virt/capture.py | cli | def cli(env, identifier, name, all, note):
"""Capture one or all disks from a virtual server to a SoftLayer image."""
vsi = SoftLayer.VSManager(env.client)
vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')
capture = vsi.capture(vs_id, name, all, note)
table = formatting.KeyValueTable(... | python | def cli(env, identifier, name, all, note):
"""Capture one or all disks from a virtual server to a SoftLayer image."""
vsi = SoftLayer.VSManager(env.client)
vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS')
capture = vsi.capture(vs_id, name, all, note)
table = formatting.KeyValueTable(... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"name",
",",
"all",
",",
"note",
")",
":",
"vsi",
"=",
"SoftLayer",
".",
"VSManager",
"(",
"env",
".",
"client",
")",
"vs_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"vsi",
".",
"resolve_ids",
",",
... | Capture one or all disks from a virtual server to a SoftLayer image. | [
"Capture",
"one",
"or",
"all",
"disks",
"from",
"a",
"virtual",
"server",
"to",
"a",
"SoftLayer",
"image",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capture.py#L20-L38 |
1,658 | softlayer/softlayer-python | SoftLayer/managers/event_log.py | EventLogManager.get_event_logs | def get_event_logs(self, request_filter=None, log_limit=20, iterator=True):
"""Returns a list of event logs
Example::
event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event... | python | def get_event_logs(self, request_filter=None, log_limit=20, iterator=True):
"""Returns a list of event logs
Example::
event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event... | [
"def",
"get_event_logs",
"(",
"self",
",",
"request_filter",
"=",
"None",
",",
"log_limit",
"=",
"20",
",",
"iterator",
"=",
"True",
")",
":",
"if",
"iterator",
":",
"# Call iter_call directly as this returns the actual generator",
"return",
"self",
".",
"client",
... | Returns a list of event logs
Example::
event_mgr = SoftLayer.EventLogManager(env.client)
request_filter = event_mgr.build_filter(date_min="01/01/2019", date_max="02/01/2019")
logs = event_mgr.get_event_logs(request_filter)
for log in logs:
print(... | [
"Returns",
"a",
"list",
"of",
"event",
"logs"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/event_log.py#L23-L44 |
1,659 | softlayer/softlayer-python | SoftLayer/managers/event_log.py | EventLogManager.build_filter | def build_filter(date_min=None, date_max=None, obj_event=None, obj_id=None, obj_type=None, utc_offset=None):
"""Returns a query filter that can be passed into EventLogManager.get_event_logs
:param string date_min: Lower bound date in MM/DD/YYYY format
:param string date_max: Upper bound date in... | python | def build_filter(date_min=None, date_max=None, obj_event=None, obj_id=None, obj_type=None, utc_offset=None):
"""Returns a query filter that can be passed into EventLogManager.get_event_logs
:param string date_min: Lower bound date in MM/DD/YYYY format
:param string date_max: Upper bound date in... | [
"def",
"build_filter",
"(",
"date_min",
"=",
"None",
",",
"date_max",
"=",
"None",
",",
"obj_event",
"=",
"None",
",",
"obj_id",
"=",
"None",
",",
"obj_type",
"=",
"None",
",",
"utc_offset",
"=",
"None",
")",
":",
"if",
"not",
"any",
"(",
"[",
"date_... | Returns a query filter that can be passed into EventLogManager.get_event_logs
:param string date_min: Lower bound date in MM/DD/YYYY format
:param string date_max: Upper bound date in MM/DD/YYYY format
:param string obj_event: The name of the events we want to filter by
:param int obj_i... | [
"Returns",
"a",
"query",
"filter",
"that",
"can",
"be",
"passed",
"into",
"EventLogManager",
".",
"get_event_logs"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/event_log.py#L55-L91 |
1,660 | softlayer/softlayer-python | SoftLayer/CLI/dns/record_list.py | cli | def cli(env, zone, data, record, ttl, type):
"""List all records in a zone."""
manager = SoftLayer.DNSManager(env.client)
table = formatting.Table(['id', 'record', 'type', 'ttl', 'data'])
table.align['ttl'] = 'l'
table.align['record'] = 'r'
table.align['data'] = 'l'
zone_id = helpers.reso... | python | def cli(env, zone, data, record, ttl, type):
"""List all records in a zone."""
manager = SoftLayer.DNSManager(env.client)
table = formatting.Table(['id', 'record', 'type', 'ttl', 'data'])
table.align['ttl'] = 'l'
table.align['record'] = 'r'
table.align['data'] = 'l'
zone_id = helpers.reso... | [
"def",
"cli",
"(",
"env",
",",
"zone",
",",
"data",
",",
"record",
",",
"ttl",
",",
"type",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"DNSManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
... | List all records in a zone. | [
"List",
"all",
"records",
"in",
"a",
"zone",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/record_list.py#L22-L49 |
1,661 | softlayer/softlayer-python | SoftLayer/CLI/ticket/subjects.py | cli | def cli(env):
"""List Subject IDs for ticket creation."""
ticket_mgr = SoftLayer.TicketManager(env.client)
table = formatting.Table(['id', 'subject'])
for subject in ticket_mgr.list_subjects():
table.add_row([subject['id'], subject['name']])
env.fout(table) | python | def cli(env):
"""List Subject IDs for ticket creation."""
ticket_mgr = SoftLayer.TicketManager(env.client)
table = formatting.Table(['id', 'subject'])
for subject in ticket_mgr.list_subjects():
table.add_row([subject['id'], subject['name']])
env.fout(table) | [
"def",
"cli",
"(",
"env",
")",
":",
"ticket_mgr",
"=",
"SoftLayer",
".",
"TicketManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'subject'",
"]",
")",
"for",
"subject",
"in",
"ticket_mgr",
".",... | List Subject IDs for ticket creation. | [
"List",
"Subject",
"IDs",
"for",
"ticket",
"creation",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/subjects.py#L13-L21 |
1,662 | softlayer/softlayer-python | SoftLayer/CLI/virt/placementgroup/create.py | cli | def cli(env, **args):
"""Create a placement group."""
manager = PlacementManager(env.client)
backend_router_id = helpers.resolve_id(manager.get_backend_router_id_from_hostname,
args.get('backend_router'),
'backendRouter')
... | python | def cli(env, **args):
"""Create a placement group."""
manager = PlacementManager(env.client)
backend_router_id = helpers.resolve_id(manager.get_backend_router_id_from_hostname,
args.get('backend_router'),
'backendRouter')
... | [
"def",
"cli",
"(",
"env",
",",
"*",
"*",
"args",
")",
":",
"manager",
"=",
"PlacementManager",
"(",
"env",
".",
"client",
")",
"backend_router_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"manager",
".",
"get_backend_router_id_from_hostname",
",",
"args",
".... | Create a placement group. | [
"Create",
"a",
"placement",
"group",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/placementgroup/create.py#L17-L31 |
1,663 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | cli | def cli(env, identifier, keys, permissions, hardware, virtual, logins, events):
"""User details."""
mgr = SoftLayer.UserManager(env.client)
user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
object_mask = "userStatus[name], parent[id, username], apiAuthenticationKeys[authenticationKe... | python | def cli(env, identifier, keys, permissions, hardware, virtual, logins, events):
"""User details."""
mgr = SoftLayer.UserManager(env.client)
user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
object_mask = "userStatus[name], parent[id, username], apiAuthenticationKeys[authenticationKe... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"keys",
",",
"permissions",
",",
"hardware",
",",
"virtual",
",",
"logins",
",",
"events",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"UserManager",
"(",
"env",
".",
"client",
")",
"user_id",
"=",
"helpers... | User details. | [
"User",
"details",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L28-L56 |
1,664 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | basic_info | def basic_info(user, keys):
"""Prints a table of basic user information"""
table = formatting.KeyValueTable(['Title', 'Basic Information'])
table.align['Title'] = 'r'
table.align['Basic Information'] = 'l'
table.add_row(['Id', user.get('id', '-')])
table.add_row(['Username', user.get('username... | python | def basic_info(user, keys):
"""Prints a table of basic user information"""
table = formatting.KeyValueTable(['Title', 'Basic Information'])
table.align['Title'] = 'r'
table.align['Basic Information'] = 'l'
table.add_row(['Id', user.get('id', '-')])
table.add_row(['Username', user.get('username... | [
"def",
"basic_info",
"(",
"user",
",",
"keys",
")",
":",
"table",
"=",
"formatting",
".",
"KeyValueTable",
"(",
"[",
"'Title'",
",",
"'Basic Information'",
"]",
")",
"table",
".",
"align",
"[",
"'Title'",
"]",
"=",
"'r'",
"table",
".",
"align",
"[",
"'... | Prints a table of basic user information | [
"Prints",
"a",
"table",
"of",
"basic",
"user",
"information"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L59-L95 |
1,665 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_permissions | def print_permissions(permissions):
"""Prints out a users permissions"""
table = formatting.Table(['keyName', 'Description'])
for perm in permissions:
table.add_row([perm['keyName'], perm['name']])
return table | python | def print_permissions(permissions):
"""Prints out a users permissions"""
table = formatting.Table(['keyName', 'Description'])
for perm in permissions:
table.add_row([perm['keyName'], perm['name']])
return table | [
"def",
"print_permissions",
"(",
"permissions",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'keyName'",
",",
"'Description'",
"]",
")",
"for",
"perm",
"in",
"permissions",
":",
"table",
".",
"add_row",
"(",
"[",
"perm",
"[",
"'keyName'",... | Prints out a users permissions | [
"Prints",
"out",
"a",
"users",
"permissions"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L98-L104 |
1,666 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_access | def print_access(access, title):
"""Prints out the hardware or virtual guests a user can access"""
columns = ['id', 'hostname', 'Primary Public IP', 'Primary Private IP', 'Created']
table = formatting.Table(columns, title)
for host in access:
host_id = host.get('id')
host_fqdn = host.g... | python | def print_access(access, title):
"""Prints out the hardware or virtual guests a user can access"""
columns = ['id', 'hostname', 'Primary Public IP', 'Primary Private IP', 'Created']
table = formatting.Table(columns, title)
for host in access:
host_id = host.get('id')
host_fqdn = host.g... | [
"def",
"print_access",
"(",
"access",
",",
"title",
")",
":",
"columns",
"=",
"[",
"'id'",
",",
"'hostname'",
",",
"'Primary Public IP'",
",",
"'Primary Private IP'",
",",
"'Created'",
"]",
"table",
"=",
"formatting",
".",
"Table",
"(",
"columns",
",",
"titl... | Prints out the hardware or virtual guests a user can access | [
"Prints",
"out",
"the",
"hardware",
"or",
"virtual",
"guests",
"a",
"user",
"can",
"access"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L107-L120 |
1,667 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_dedicated_access | def print_dedicated_access(access):
"""Prints out the dedicated hosts a user can access"""
table = formatting.Table(['id', 'Name', 'Cpus', 'Memory', 'Disk', 'Created'], 'Dedicated Access')
for host in access:
host_id = host.get('id')
host_fqdn = host.get('name')
host_cpu = host.get(... | python | def print_dedicated_access(access):
"""Prints out the dedicated hosts a user can access"""
table = formatting.Table(['id', 'Name', 'Cpus', 'Memory', 'Disk', 'Created'], 'Dedicated Access')
for host in access:
host_id = host.get('id')
host_fqdn = host.get('name')
host_cpu = host.get(... | [
"def",
"print_dedicated_access",
"(",
"access",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'id'",
",",
"'Name'",
",",
"'Cpus'",
",",
"'Memory'",
",",
"'Disk'",
",",
"'Created'",
"]",
",",
"'Dedicated Access'",
")",
"for",
"host",
"in",
... | Prints out the dedicated hosts a user can access | [
"Prints",
"out",
"the",
"dedicated",
"hosts",
"a",
"user",
"can",
"access"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L123-L135 |
1,668 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_logins | def print_logins(logins):
"""Prints out the login history for a user"""
table = formatting.Table(['Date', 'IP Address', 'Successufl Login?'])
for login in logins:
table.add_row([login.get('createDate'), login.get('ipAddress'), login.get('successFlag')])
return table | python | def print_logins(logins):
"""Prints out the login history for a user"""
table = formatting.Table(['Date', 'IP Address', 'Successufl Login?'])
for login in logins:
table.add_row([login.get('createDate'), login.get('ipAddress'), login.get('successFlag')])
return table | [
"def",
"print_logins",
"(",
"logins",
")",
":",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'Date'",
",",
"'IP Address'",
",",
"'Successufl Login?'",
"]",
")",
"for",
"login",
"in",
"logins",
":",
"table",
".",
"add_row",
"(",
"[",
"login",
".",... | Prints out the login history for a user | [
"Prints",
"out",
"the",
"login",
"history",
"for",
"a",
"user"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L138-L143 |
1,669 | softlayer/softlayer-python | SoftLayer/CLI/user/detail.py | print_events | def print_events(events):
"""Prints out the event log for a user"""
columns = ['Date', 'Type', 'IP Address', 'label', 'username']
table = formatting.Table(columns)
for event in events:
table.add_row([event.get('eventCreateDate'), event.get('eventName'),
event.get('ipAddres... | python | def print_events(events):
"""Prints out the event log for a user"""
columns = ['Date', 'Type', 'IP Address', 'label', 'username']
table = formatting.Table(columns)
for event in events:
table.add_row([event.get('eventCreateDate'), event.get('eventName'),
event.get('ipAddres... | [
"def",
"print_events",
"(",
"events",
")",
":",
"columns",
"=",
"[",
"'Date'",
",",
"'Type'",
",",
"'IP Address'",
",",
"'label'",
",",
"'username'",
"]",
"table",
"=",
"formatting",
".",
"Table",
"(",
"columns",
")",
"for",
"event",
"in",
"events",
":",... | Prints out the event log for a user | [
"Prints",
"out",
"the",
"event",
"log",
"for",
"a",
"user"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/detail.py#L146-L153 |
1,670 | softlayer/softlayer-python | SoftLayer/CLI/user/delete.py | cli | def cli(env, identifier):
"""Sets a user's status to CANCEL_PENDING, which will immediately disable the account,
and will eventually be fully removed from the account by an automated internal process.
Example: slcli user delete userId
"""
mgr = SoftLayer.UserManager(env.client)
user_id = hel... | python | def cli(env, identifier):
"""Sets a user's status to CANCEL_PENDING, which will immediately disable the account,
and will eventually be fully removed from the account by an automated internal process.
Example: slcli user delete userId
"""
mgr = SoftLayer.UserManager(env.client)
user_id = hel... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"UserManager",
"(",
"env",
".",
"client",
")",
"user_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"mgr",
".",
"resolve_ids",
",",
"identifier",
",",
"'username'",
")",
... | Sets a user's status to CANCEL_PENDING, which will immediately disable the account,
and will eventually be fully removed from the account by an automated internal process.
Example: slcli user delete userId | [
"Sets",
"a",
"user",
"s",
"status",
"to",
"CANCEL_PENDING",
"which",
"will",
"immediately",
"disable",
"the",
"account"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/delete.py#L14-L32 |
1,671 | softlayer/softlayer-python | SoftLayer/CLI/ssl/edit.py | cli | def cli(env, identifier, crt, csr, icc, key, notes):
"""Edit SSL certificate."""
template = {'id': identifier}
if crt:
template['certificate'] = open(crt).read()
if key:
template['privateKey'] = open(key).read()
if csr:
template['certificateSigningRequest'] = open(csr).read()... | python | def cli(env, identifier, crt, csr, icc, key, notes):
"""Edit SSL certificate."""
template = {'id': identifier}
if crt:
template['certificate'] = open(crt).read()
if key:
template['privateKey'] = open(key).read()
if csr:
template['certificateSigningRequest'] = open(csr).read()... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
",",
"crt",
",",
"csr",
",",
"icc",
",",
"key",
",",
"notes",
")",
":",
"template",
"=",
"{",
"'id'",
":",
"identifier",
"}",
"if",
"crt",
":",
"template",
"[",
"'certificate'",
"]",
"=",
"open",
"(",
... | Edit SSL certificate. | [
"Edit",
"SSL",
"certificate",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/edit.py#L24-L39 |
1,672 | softlayer/softlayer-python | SoftLayer/CLI/cdn/origin_add.py | cli | def cli(env, account_id, content_url, type, cname):
"""Create an origin pull mapping."""
manager = SoftLayer.CDNManager(env.client)
manager.add_origin(account_id, type, content_url, cname) | python | def cli(env, account_id, content_url, type, cname):
"""Create an origin pull mapping."""
manager = SoftLayer.CDNManager(env.client)
manager.add_origin(account_id, type, content_url, cname) | [
"def",
"cli",
"(",
"env",
",",
"account_id",
",",
"content_url",
",",
"type",
",",
"cname",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"CDNManager",
"(",
"env",
".",
"client",
")",
"manager",
".",
"add_origin",
"(",
"account_id",
",",
"type",
",",
"co... | Create an origin pull mapping. | [
"Create",
"an",
"origin",
"pull",
"mapping",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/cdn/origin_add.py#L22-L26 |
1,673 | softlayer/softlayer-python | SoftLayer/CLI/template.py | export_to_template | def export_to_template(filename, args, exclude=None):
"""Exports given options to the given filename in INI format.
:param filename: Filename to save options to
:param dict args: Arguments to export
:param list exclude (optional): Exclusion list for options that should not
... | python | def export_to_template(filename, args, exclude=None):
"""Exports given options to the given filename in INI format.
:param filename: Filename to save options to
:param dict args: Arguments to export
:param list exclude (optional): Exclusion list for options that should not
... | [
"def",
"export_to_template",
"(",
"filename",
",",
"args",
",",
"exclude",
"=",
"None",
")",
":",
"exclude",
"=",
"exclude",
"or",
"[",
"]",
"exclude",
".",
"append",
"(",
"'config'",
")",
"exclude",
".",
"append",
"(",
"'really'",
")",
"exclude",
".",
... | Exports given options to the given filename in INI format.
:param filename: Filename to save options to
:param dict args: Arguments to export
:param list exclude (optional): Exclusion list for options that should not
be exported | [
"Exports",
"given",
"options",
"to",
"the",
"given",
"filename",
"in",
"INI",
"format",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/template.py#L47-L68 |
1,674 | softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.list | def list(self, mask=None):
"""List existing placement groups
Calls SoftLayer_Account::getPlacementGroups
"""
if mask is None:
mask = "mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]"
groups = self.client.call('Account', 'getPlacementGroups'... | python | def list(self, mask=None):
"""List existing placement groups
Calls SoftLayer_Account::getPlacementGroups
"""
if mask is None:
mask = "mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]"
groups = self.client.call('Account', 'getPlacementGroups'... | [
"def",
"list",
"(",
"self",
",",
"mask",
"=",
"None",
")",
":",
"if",
"mask",
"is",
"None",
":",
"mask",
"=",
"\"mask[id, name, createDate, rule, guestCount, backendRouter[id, hostname]]\"",
"groups",
"=",
"self",
".",
"client",
".",
"call",
"(",
"'Account'",
",... | List existing placement groups
Calls SoftLayer_Account::getPlacementGroups | [
"List",
"existing",
"placement",
"groups"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L40-L48 |
1,675 | softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.get_object | def get_object(self, group_id, mask=None):
"""Returns a PlacementGroup Object
https://softlayer.github.io/reference/services/SoftLayer_Virtual_PlacementGroup/getObject
"""
if mask is None:
mask = "mask[id, name, createDate, rule, backendRouter[id, hostname]," \
... | python | def get_object(self, group_id, mask=None):
"""Returns a PlacementGroup Object
https://softlayer.github.io/reference/services/SoftLayer_Virtual_PlacementGroup/getObject
"""
if mask is None:
mask = "mask[id, name, createDate, rule, backendRouter[id, hostname]," \
... | [
"def",
"get_object",
"(",
"self",
",",
"group_id",
",",
"mask",
"=",
"None",
")",
":",
"if",
"mask",
"is",
"None",
":",
"mask",
"=",
"\"mask[id, name, createDate, rule, backendRouter[id, hostname],\"",
"\"guests[activeTransaction[id,transactionStatus[name,friendlyName]]]]\"",... | Returns a PlacementGroup Object
https://softlayer.github.io/reference/services/SoftLayer_Virtual_PlacementGroup/getObject | [
"Returns",
"a",
"PlacementGroup",
"Object"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L72-L80 |
1,676 | softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.get_rule_id_from_name | def get_rule_id_from_name(self, name):
"""Finds the rule that matches name.
SoftLayer_Virtual_PlacementGroup_Rule.getAllObjects doesn't support objectFilters.
"""
results = self.client.call('SoftLayer_Virtual_PlacementGroup_Rule', 'getAllObjects')
return [result['id'] for result... | python | def get_rule_id_from_name(self, name):
"""Finds the rule that matches name.
SoftLayer_Virtual_PlacementGroup_Rule.getAllObjects doesn't support objectFilters.
"""
results = self.client.call('SoftLayer_Virtual_PlacementGroup_Rule', 'getAllObjects')
return [result['id'] for result... | [
"def",
"get_rule_id_from_name",
"(",
"self",
",",
"name",
")",
":",
"results",
"=",
"self",
".",
"client",
".",
"call",
"(",
"'SoftLayer_Virtual_PlacementGroup_Rule'",
",",
"'getAllObjects'",
")",
"return",
"[",
"result",
"[",
"'id'",
"]",
"for",
"result",
"in... | Finds the rule that matches name.
SoftLayer_Virtual_PlacementGroup_Rule.getAllObjects doesn't support objectFilters. | [
"Finds",
"the",
"rule",
"that",
"matches",
"name",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L94-L100 |
1,677 | softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager.get_backend_router_id_from_hostname | def get_backend_router_id_from_hostname(self, hostname):
"""Finds the backend router Id that matches the hostname given
No way to use an objectFilter to find a backendRouter, so we have to search the hard way.
"""
results = self.client.call('SoftLayer_Network_Pod', 'getAllObjects')
... | python | def get_backend_router_id_from_hostname(self, hostname):
"""Finds the backend router Id that matches the hostname given
No way to use an objectFilter to find a backendRouter, so we have to search the hard way.
"""
results = self.client.call('SoftLayer_Network_Pod', 'getAllObjects')
... | [
"def",
"get_backend_router_id_from_hostname",
"(",
"self",
",",
"hostname",
")",
":",
"results",
"=",
"self",
".",
"client",
".",
"call",
"(",
"'SoftLayer_Network_Pod'",
",",
"'getAllObjects'",
")",
"return",
"[",
"result",
"[",
"'backendRouterId'",
"]",
"for",
... | Finds the backend router Id that matches the hostname given
No way to use an objectFilter to find a backendRouter, so we have to search the hard way. | [
"Finds",
"the",
"backend",
"router",
"Id",
"that",
"matches",
"the",
"hostname",
"given"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L102-L108 |
1,678 | softlayer/softlayer-python | SoftLayer/managers/vs_placement.py | PlacementManager._get_id_from_name | def _get_id_from_name(self, name):
"""List placement group ids which match the given name."""
_filter = {
'placementGroups': {
'name': {'operation': name}
}
}
mask = "mask[id, name]"
results = self.client.call('Account', 'getPlacementGroups... | python | def _get_id_from_name(self, name):
"""List placement group ids which match the given name."""
_filter = {
'placementGroups': {
'name': {'operation': name}
}
}
mask = "mask[id, name]"
results = self.client.call('Account', 'getPlacementGroups... | [
"def",
"_get_id_from_name",
"(",
"self",
",",
"name",
")",
":",
"_filter",
"=",
"{",
"'placementGroups'",
":",
"{",
"'name'",
":",
"{",
"'operation'",
":",
"name",
"}",
"}",
"}",
"mask",
"=",
"\"mask[id, name]\"",
"results",
"=",
"self",
".",
"client",
"... | List placement group ids which match the given name. | [
"List",
"placement",
"group",
"ids",
"which",
"match",
"the",
"given",
"name",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/vs_placement.py#L110-L119 |
1,679 | softlayer/softlayer-python | SoftLayer/CLI/virt/capacity/create_options.py | cli | def cli(env):
"""List options for creating Reserved Capacity"""
manager = CapacityManager(env.client)
items = manager.get_create_options()
items.sort(key=lambda term: int(term['capacity']))
table = formatting.Table(["KeyName", "Description", "Term", "Default Hourly Price Per Instance"],
... | python | def cli(env):
"""List options for creating Reserved Capacity"""
manager = CapacityManager(env.client)
items = manager.get_create_options()
items.sort(key=lambda term: int(term['capacity']))
table = formatting.Table(["KeyName", "Description", "Term", "Default Hourly Price Per Instance"],
... | [
"def",
"cli",
"(",
"env",
")",
":",
"manager",
"=",
"CapacityManager",
"(",
"env",
".",
"client",
")",
"items",
"=",
"manager",
".",
"get_create_options",
"(",
")",
"items",
".",
"sort",
"(",
"key",
"=",
"lambda",
"term",
":",
"int",
"(",
"term",
"["... | List options for creating Reserved Capacity | [
"List",
"options",
"for",
"creating",
"Reserved",
"Capacity"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_options.py#L13-L36 |
1,680 | softlayer/softlayer-python | SoftLayer/CLI/virt/capacity/create_options.py | get_price | def get_price(item):
"""Finds the price with the default locationGroupId"""
the_price = "No Default Pricing"
for price in item.get('prices', []):
if not price.get('locationGroupId'):
the_price = "%0.4f" % float(price['hourlyRecurringFee'])
return the_price | python | def get_price(item):
"""Finds the price with the default locationGroupId"""
the_price = "No Default Pricing"
for price in item.get('prices', []):
if not price.get('locationGroupId'):
the_price = "%0.4f" % float(price['hourlyRecurringFee'])
return the_price | [
"def",
"get_price",
"(",
"item",
")",
":",
"the_price",
"=",
"\"No Default Pricing\"",
"for",
"price",
"in",
"item",
".",
"get",
"(",
"'prices'",
",",
"[",
"]",
")",
":",
"if",
"not",
"price",
".",
"get",
"(",
"'locationGroupId'",
")",
":",
"the_price",
... | Finds the price with the default locationGroupId | [
"Finds",
"the",
"price",
"with",
"the",
"default",
"locationGroupId"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create_options.py#L39-L45 |
1,681 | softlayer/softlayer-python | SoftLayer/CLI/order/package_list.py | cli | def cli(env, keyword, package_type):
"""List packages that can be ordered via the placeOrder API.
::
# List out all packages for ordering
slcli order package-list
# List out all packages with "server" in the name
slcli order package-list --keyword server
# Select onl... | python | def cli(env, keyword, package_type):
"""List packages that can be ordered via the placeOrder API.
::
# List out all packages for ordering
slcli order package-list
# List out all packages with "server" in the name
slcli order package-list --keyword server
# Select onl... | [
"def",
"cli",
"(",
"env",
",",
"keyword",
",",
"package_type",
")",
":",
"manager",
"=",
"ordering",
".",
"OrderingManager",
"(",
"env",
".",
"client",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"COLUMNS",
")",
"_filter",
"=",
"{",
"'type'",
"... | List packages that can be ordered via the placeOrder API.
::
# List out all packages for ordering
slcli order package-list
# List out all packages with "server" in the name
slcli order package-list --keyword server
# Select only specifict package types
slcli orde... | [
"List",
"packages",
"that",
"can",
"be",
"ordered",
"via",
"the",
"placeOrder",
"API",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/order/package_list.py#L20-L53 |
1,682 | softlayer/softlayer-python | SoftLayer/CLI/loadbal/list.py | cli | def cli(env):
"""List active load balancers."""
mgr = SoftLayer.LoadBalancerManager(env.client)
load_balancers = mgr.get_local_lbs()
table = formatting.Table(['ID',
'VIP Address',
'Location',
'SSL Offload',
... | python | def cli(env):
"""List active load balancers."""
mgr = SoftLayer.LoadBalancerManager(env.client)
load_balancers = mgr.get_local_lbs()
table = formatting.Table(['ID',
'VIP Address',
'Location',
'SSL Offload',
... | [
"def",
"cli",
"(",
"env",
")",
":",
"mgr",
"=",
"SoftLayer",
".",
"LoadBalancerManager",
"(",
"env",
".",
"client",
")",
"load_balancers",
"=",
"mgr",
".",
"get_local_lbs",
"(",
")",
"table",
"=",
"formatting",
".",
"Table",
"(",
"[",
"'ID'",
",",
"'VI... | List active load balancers. | [
"List",
"active",
"load",
"balancers",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/list.py#L13-L49 |
1,683 | softlayer/softlayer-python | SoftLayer/CLI/hardware/credentials.py | cli | def cli(env, identifier):
"""List server credentials."""
manager = SoftLayer.HardwareManager(env.client)
hardware_id = helpers.resolve_id(manager.resolve_ids,
identifier,
'hardware')
instance = manager.get_hardware(hardware_id)
... | python | def cli(env, identifier):
"""List server credentials."""
manager = SoftLayer.HardwareManager(env.client)
hardware_id = helpers.resolve_id(manager.resolve_ids,
identifier,
'hardware')
instance = manager.get_hardware(hardware_id)
... | [
"def",
"cli",
"(",
"env",
",",
"identifier",
")",
":",
"manager",
"=",
"SoftLayer",
".",
"HardwareManager",
"(",
"env",
".",
"client",
")",
"hardware_id",
"=",
"helpers",
".",
"resolve_id",
"(",
"manager",
".",
"resolve_ids",
",",
"identifier",
",",
"'hard... | List server credentials. | [
"List",
"server",
"credentials",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/credentials.py#L16-L31 |
1,684 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | populate_host_templates | def populate_host_templates(host_templates,
hardware_ids=None,
virtual_guest_ids=None,
ip_address_ids=None,
subnet_ids=None):
"""Populate the given host_templates array with the IDs provided
:param h... | python | def populate_host_templates(host_templates,
hardware_ids=None,
virtual_guest_ids=None,
ip_address_ids=None,
subnet_ids=None):
"""Populate the given host_templates array with the IDs provided
:param h... | [
"def",
"populate_host_templates",
"(",
"host_templates",
",",
"hardware_ids",
"=",
"None",
",",
"virtual_guest_ids",
"=",
"None",
",",
"ip_address_ids",
"=",
"None",
",",
"subnet_ids",
"=",
"None",
")",
":",
"if",
"hardware_ids",
"is",
"not",
"None",
":",
"for... | Populate the given host_templates array with the IDs provided
:param host_templates: The array to which host templates will be added
:param hardware_ids: A List of SoftLayer_Hardware ids
:param virtual_guest_ids: A List of SoftLayer_Virtual_Guest ids
:param ip_address_ids: A List of SoftLayer_Network_S... | [
"Populate",
"the",
"given",
"host_templates",
"array",
"with",
"the",
"IDs",
"provided"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L22-L61 |
1,685 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | get_package | def get_package(manager, category_code):
"""Returns a product package based on type of storage.
:param manager: The storage manager which calls this function.
:param category_code: Category code of product package.
:return: Returns a packaged based on type of storage.
"""
_filter = utils.Neste... | python | def get_package(manager, category_code):
"""Returns a product package based on type of storage.
:param manager: The storage manager which calls this function.
:param category_code: Category code of product package.
:return: Returns a packaged based on type of storage.
"""
_filter = utils.Neste... | [
"def",
"get_package",
"(",
"manager",
",",
"category_code",
")",
":",
"_filter",
"=",
"utils",
".",
"NestedDict",
"(",
"{",
"}",
")",
"_filter",
"[",
"'categories'",
"]",
"[",
"'categoryCode'",
"]",
"=",
"(",
"utils",
".",
"query_filter",
"(",
"category_co... | Returns a product package based on type of storage.
:param manager: The storage manager which calls this function.
:param category_code: Category code of product package.
:return: Returns a packaged based on type of storage. | [
"Returns",
"a",
"product",
"package",
"based",
"on",
"type",
"of",
"storage",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L64-L88 |
1,686 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | get_location_id | def get_location_id(manager, location):
"""Returns location id
:param manager: The storage manager which calls this function.
:param location: Datacenter short name
:return: Returns location id
"""
loc_svc = manager.client['Location_Datacenter']
datacenters = loc_svc.getDatacenters(mask='ma... | python | def get_location_id(manager, location):
"""Returns location id
:param manager: The storage manager which calls this function.
:param location: Datacenter short name
:return: Returns location id
"""
loc_svc = manager.client['Location_Datacenter']
datacenters = loc_svc.getDatacenters(mask='ma... | [
"def",
"get_location_id",
"(",
"manager",
",",
"location",
")",
":",
"loc_svc",
"=",
"manager",
".",
"client",
"[",
"'Location_Datacenter'",
"]",
"datacenters",
"=",
"loc_svc",
".",
"getDatacenters",
"(",
"mask",
"=",
"'mask[longName,id,name]'",
")",
"for",
"dat... | Returns location id
:param manager: The storage manager which calls this function.
:param location: Datacenter short name
:return: Returns location id | [
"Returns",
"location",
"id"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L91-L104 |
1,687 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_price_by_category | def find_price_by_category(package, price_category):
"""Find the price in the given package that has the specified category
:param package: The AsAService, Enterprise, or Performance product package
:param price_category: The price category code to search for
:return: Returns the price for the given ca... | python | def find_price_by_category(package, price_category):
"""Find the price in the given package that has the specified category
:param package: The AsAService, Enterprise, or Performance product package
:param price_category: The price category code to search for
:return: Returns the price for the given ca... | [
"def",
"find_price_by_category",
"(",
"package",
",",
"price_category",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"price_id",
"=",
"_find_price_id",
"(",
"item",
"[",
"'prices'",
"]",
",",
"price_category",
")",
"if",
"price_id",
":... | Find the price in the given package that has the specified category
:param package: The AsAService, Enterprise, or Performance product package
:param price_category: The price category code to search for
:return: Returns the price for the given category, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"that",
"has",
"the",
"specified",
"category"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L107-L119 |
1,688 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_ent_space_price | def find_ent_space_price(package, category, size, tier_level):
"""Find the space price for the given category, size, and tier
:param package: The Enterprise (Endurance) product package
:param category: The category of space (endurance, replication, snapshot)
:param size: The size for which a price is d... | python | def find_ent_space_price(package, category, size, tier_level):
"""Find the space price for the given category, size, and tier
:param package: The Enterprise (Endurance) product package
:param category: The category of space (endurance, replication, snapshot)
:param size: The size for which a price is d... | [
"def",
"find_ent_space_price",
"(",
"package",
",",
"category",
",",
"size",
",",
"tier_level",
")",
":",
"if",
"category",
"==",
"'snapshot'",
":",
"category_code",
"=",
"'storage_snapshot_space'",
"elif",
"category",
"==",
"'replication'",
":",
"category_code",
... | Find the space price for the given category, size, and tier
:param package: The Enterprise (Endurance) product package
:param category: The category of space (endurance, replication, snapshot)
:param size: The size for which a price is desired
:param tier_level: The endurance tier for which a price is ... | [
"Find",
"the",
"space",
"price",
"for",
"the",
"given",
"category",
"size",
"and",
"tier"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L122-L147 |
1,689 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_ent_endurance_tier_price | def find_ent_endurance_tier_price(package, tier_level):
"""Find the price in the given package with the specified tier level
:param package: The Enterprise (Endurance) product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an... | python | def find_ent_endurance_tier_price(package, tier_level):
"""Find the price in the given package with the specified tier level
:param package: The Enterprise (Endurance) product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an... | [
"def",
"find_ent_endurance_tier_price",
"(",
"package",
",",
"tier_level",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"for",
"attribute",
"in",
"item",
".",
"get",
"(",
"'attributes'",
",",
"[",
"]",
")",
":",
"if",
"int",
"(",
... | Find the price in the given package with the specified tier level
:param package: The Enterprise (Endurance) product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"with",
"the",
"specified",
"tier",
"level"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L150-L168 |
1,690 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_perf_space_price | def find_perf_space_price(package, size):
"""Find the price in the given package with the specified size
:param package: The Performance product package
:param size: The storage space size for which a price is desired
:return: Returns the price for the given size, or an error if not found
"""
f... | python | def find_perf_space_price(package, size):
"""Find the price in the given package with the specified size
:param package: The Performance product package
:param size: The storage space size for which a price is desired
:return: Returns the price for the given size, or an error if not found
"""
f... | [
"def",
"find_perf_space_price",
"(",
"package",
",",
"size",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"int",
"(",
"item",
"[",
"'capacity'",
"]",
")",
"!=",
"size",
":",
"continue",
"price_id",
"=",
"_find_price_id",
"(",... | Find the price in the given package with the specified size
:param package: The Performance product package
:param size: The storage space size for which a price is desired
:return: Returns the price for the given size, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"with",
"the",
"specified",
"size"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L194-L209 |
1,691 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_perf_iops_price | def find_perf_iops_price(package, size, iops):
"""Find the price in the given package with the specified size and iops
:param package: The Performance product package
:param size: The size of storage space for which an IOPS price is desired
:param iops: The number of IOPS for which a price is desired
... | python | def find_perf_iops_price(package, size, iops):
"""Find the price in the given package with the specified size and iops
:param package: The Performance product package
:param size: The size of storage space for which an IOPS price is desired
:param iops: The number of IOPS for which a price is desired
... | [
"def",
"find_perf_iops_price",
"(",
"package",
",",
"size",
",",
"iops",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"int",
"(",
"item",
"[",
"'capacity'",
"]",
")",
"!=",
"int",
"(",
"iops",
")",
":",
"continue",
"price... | Find the price in the given package with the specified size and iops
:param package: The Performance product package
:param size: The size of storage space for which an IOPS price is desired
:param iops: The number of IOPS for which a price is desired
:return: Returns the price for the size and IOPS, o... | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"with",
"the",
"specified",
"size",
"and",
"iops"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L212-L228 |
1,692 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_endurance_space_price | def find_saas_endurance_space_price(package, size, tier_level):
"""Find the SaaS endurance storage space price for the size and tier
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param tier_level: The endurance tier for which a price... | python | def find_saas_endurance_space_price(package, size, tier_level):
"""Find the SaaS endurance storage space price for the size and tier
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param tier_level: The endurance tier for which a price... | [
"def",
"find_saas_endurance_space_price",
"(",
"package",
",",
"size",
",",
"tier_level",
")",
":",
"if",
"tier_level",
"!=",
"0.25",
":",
"tier_level",
"=",
"int",
"(",
"tier_level",
")",
"key_name",
"=",
"'STORAGE_SPACE_FOR_{0}_IOPS_PER_GB'",
".",
"format",
"(",... | Find the SaaS endurance storage space price for the size and tier
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the size and tier, or an... | [
"Find",
"the",
"SaaS",
"endurance",
"storage",
"space",
"price",
"for",
"the",
"size",
"and",
"tier"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L231-L259 |
1,693 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_endurance_tier_price | def find_saas_endurance_tier_price(package, tier_level):
"""Find the SaaS storage tier level price for the specified tier level
:param package: The Storage As A Service product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or a... | python | def find_saas_endurance_tier_price(package, tier_level):
"""Find the SaaS storage tier level price for the specified tier level
:param package: The Storage As A Service product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or a... | [
"def",
"find_saas_endurance_tier_price",
"(",
"package",
",",
"tier_level",
")",
":",
"target_capacity",
"=",
"ENDURANCE_TIERS",
".",
"get",
"(",
"tier_level",
")",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"'itemCategory'",
"not",
"in",
... | Find the SaaS storage tier level price for the specified tier level
:param package: The Storage As A Service product package
:param tier_level: The endurance tier for which a price is desired
:return: Returns the price for the given tier, or an error if not found | [
"Find",
"the",
"SaaS",
"storage",
"tier",
"level",
"price",
"for",
"the",
"specified",
"tier",
"level"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L262-L284 |
1,694 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_perform_space_price | def find_saas_perform_space_price(package, size):
"""Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not f... | python | def find_saas_perform_space_price(package, size):
"""Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not f... | [
"def",
"find_saas_perform_space_price",
"(",
"package",
",",
"size",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"'itemCategory'",
"not",
"in",
"item",
"or",
"'categoryCode'",
"not",
"in",
"item",
"[",
"'itemCategory'",
"]",
"or... | Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not found | [
"Find",
"the",
"SaaS",
"performance",
"storage",
"space",
"price",
"for",
"the",
"given",
"size"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L287-L316 |
1,695 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_perform_iops_price | def find_saas_perform_iops_price(package, size, iops):
"""Find the SaaS IOPS price for the specified size and iops
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param iops: The number of IOPS for which a price is desired
:return:... | python | def find_saas_perform_iops_price(package, size, iops):
"""Find the SaaS IOPS price for the specified size and iops
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param iops: The number of IOPS for which a price is desired
:return:... | [
"def",
"find_saas_perform_iops_price",
"(",
"package",
",",
"size",
",",
"iops",
")",
":",
"for",
"item",
"in",
"package",
"[",
"'items'",
"]",
":",
"if",
"'itemCategory'",
"not",
"in",
"item",
"or",
"'categoryCode'",
"not",
"in",
"item",
"[",
"'itemCategory... | Find the SaaS IOPS price for the specified size and iops
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:param iops: The number of IOPS for which a price is desired
:return: Returns the price for the size and IOPS, or an error if not f... | [
"Find",
"the",
"SaaS",
"IOPS",
"price",
"for",
"the",
"specified",
"size",
"and",
"iops"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L319-L346 |
1,696 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_snapshot_space_price | def find_saas_snapshot_space_price(package, size, tier=None, iops=None):
"""Find the price in the SaaS package for the desired snapshot space size
:param package: The product package of the endurance storage type
:param size: The snapshot space size for which a price is desired
:param tier: The tier of... | python | def find_saas_snapshot_space_price(package, size, tier=None, iops=None):
"""Find the price in the SaaS package for the desired snapshot space size
:param package: The product package of the endurance storage type
:param size: The snapshot space size for which a price is desired
:param tier: The tier of... | [
"def",
"find_saas_snapshot_space_price",
"(",
"package",
",",
"size",
",",
"tier",
"=",
"None",
",",
"iops",
"=",
"None",
")",
":",
"if",
"tier",
"is",
"not",
"None",
":",
"target_value",
"=",
"ENDURANCE_TIERS",
".",
"get",
"(",
"tier",
")",
"target_restri... | Find the price in the SaaS package for the desired snapshot space size
:param package: The product package of the endurance storage type
:param size: The snapshot space size for which a price is desired
:param tier: The tier of the volume for which space is being ordered
:param iops: The IOPS of the vo... | [
"Find",
"the",
"price",
"in",
"the",
"SaaS",
"package",
"for",
"the",
"desired",
"snapshot",
"space",
"size"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L349-L373 |
1,697 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_saas_replication_price | def find_saas_replication_price(package, tier=None, iops=None):
"""Find the price in the given package for the desired replicant volume
:param package: The product package of the endurance storage type
:param tier: The tier of the primary storage volume
:param iops: The IOPS of the primary storage volu... | python | def find_saas_replication_price(package, tier=None, iops=None):
"""Find the price in the given package for the desired replicant volume
:param package: The product package of the endurance storage type
:param tier: The tier of the primary storage volume
:param iops: The IOPS of the primary storage volu... | [
"def",
"find_saas_replication_price",
"(",
"package",
",",
"tier",
"=",
"None",
",",
"iops",
"=",
"None",
")",
":",
"if",
"tier",
"is",
"not",
"None",
":",
"target_value",
"=",
"ENDURANCE_TIERS",
".",
"get",
"(",
"tier",
")",
"target_item_keyname",
"=",
"'... | Find the price in the given package for the desired replicant volume
:param package: The product package of the endurance storage type
:param tier: The tier of the primary storage volume
:param iops: The IOPS of the primary storage volume
:return: Returns the replication price, or an error if not found | [
"Find",
"the",
"price",
"in",
"the",
"given",
"package",
"for",
"the",
"desired",
"replicant",
"volume"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L376-L406 |
1,698 | softlayer/softlayer-python | SoftLayer/managers/storage_utils.py | find_snapshot_schedule_id | def find_snapshot_schedule_id(volume, snapshot_schedule_keyname):
"""Find the snapshot schedule ID for the given volume and keyname
:param volume: The volume for which the snapshot ID is desired
:param snapshot_schedule_keyname: The keyname of the snapshot schedule
:return: Returns an int value indicat... | python | def find_snapshot_schedule_id(volume, snapshot_schedule_keyname):
"""Find the snapshot schedule ID for the given volume and keyname
:param volume: The volume for which the snapshot ID is desired
:param snapshot_schedule_keyname: The keyname of the snapshot schedule
:return: Returns an int value indicat... | [
"def",
"find_snapshot_schedule_id",
"(",
"volume",
",",
"snapshot_schedule_keyname",
")",
":",
"for",
"schedule",
"in",
"volume",
"[",
"'schedules'",
"]",
":",
"if",
"'type'",
"in",
"schedule",
"and",
"'keyname'",
"in",
"schedule",
"[",
"'type'",
"]",
":",
"if... | Find the snapshot schedule ID for the given volume and keyname
:param volume: The volume for which the snapshot ID is desired
:param snapshot_schedule_keyname: The keyname of the snapshot schedule
:return: Returns an int value indicating the volume's snapshot schedule ID | [
"Find",
"the",
"snapshot",
"schedule",
"ID",
"for",
"the",
"given",
"volume",
"and",
"keyname"
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/storage_utils.py#L409-L422 |
1,699 | softlayer/softlayer-python | SoftLayer/CLI/file/snapshot/cancel.py | cli | def cli(env, volume_id, reason, immediate):
"""Cancel existing snapshot space for a given volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
raise exceptions.CLIAbort('Aborted')
cancelled = file_st... | python | def cli(env, volume_id, reason, immediate):
"""Cancel existing snapshot space for a given volume."""
file_storage_manager = SoftLayer.FileStorageManager(env.client)
if not (env.skip_confirmations or formatting.no_going_back(volume_id)):
raise exceptions.CLIAbort('Aborted')
cancelled = file_st... | [
"def",
"cli",
"(",
"env",
",",
"volume_id",
",",
"reason",
",",
"immediate",
")",
":",
"file_storage_manager",
"=",
"SoftLayer",
".",
"FileStorageManager",
"(",
"env",
".",
"client",
")",
"if",
"not",
"(",
"env",
".",
"skip_confirmations",
"or",
"formatting"... | Cancel existing snapshot space for a given volume. | [
"Cancel",
"existing",
"snapshot",
"space",
"for",
"a",
"given",
"volume",
"."
] | 9f181be08cc3668353b05a6de0cb324f52cff6fa | https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/cancel.py#L20-L40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.