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,400
softlayer/softlayer-python
SoftLayer/managers/dns.py
DNSManager.create_record_ptr
def create_record_ptr(self, record, data, ttl=60): """Create a reverse record. :param record: the public ip address of device for which you would like to manage reverse DNS. :param data: the record's value :param integer ttl: the TTL or time-to-live value (default: 60) """ ...
python
def create_record_ptr(self, record, data, ttl=60): """Create a reverse record. :param record: the public ip address of device for which you would like to manage reverse DNS. :param data: the record's value :param integer ttl: the TTL or time-to-live value (default: 60) """ ...
[ "def", "create_record_ptr", "(", "self", ",", "record", ",", "data", ",", "ttl", "=", "60", ")", ":", "resource_record", "=", "self", ".", "_generate_create_dict", "(", "record", ",", "'PTR'", ",", "data", ",", "ttl", ")", "return", "self", ".", "record"...
Create a reverse record. :param record: the public ip address of device for which you would like to manage reverse DNS. :param data: the record's value :param integer ttl: the TTL or time-to-live value (default: 60)
[ "Create", "a", "reverse", "record", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dns.py#L139-L149
1,401
softlayer/softlayer-python
SoftLayer/managers/dns.py
DNSManager.get_records
def get_records(self, zone_id, ttl=None, data=None, host=None, record_type=None): """List, and optionally filter, records within a zone. :param zone: the zone name in which to search. :param int ttl: time in seconds :param str data: the records data :param st...
python
def get_records(self, zone_id, ttl=None, data=None, host=None, record_type=None): """List, and optionally filter, records within a zone. :param zone: the zone name in which to search. :param int ttl: time in seconds :param str data: the records data :param st...
[ "def", "get_records", "(", "self", ",", "zone_id", ",", "ttl", "=", "None", ",", "data", "=", "None", ",", "host", "=", "None", ",", "record_type", "=", "None", ")", ":", "_filter", "=", "utils", ".", "NestedDict", "(", ")", "if", "ttl", ":", "_fil...
List, and optionally filter, records within a zone. :param zone: the zone name in which to search. :param int ttl: time in seconds :param str data: the records data :param str host: record's host :param str record_type: the type of record :returns: A list of dictionarie...
[ "List", "and", "optionally", "filter", "records", "within", "a", "zone", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dns.py#L183-L218
1,402
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.cancel_guests
def cancel_guests(self, host_id): """Cancel all guests into the dedicated host immediately. To cancel an specified guest use the method VSManager.cancel_instance() :param host_id: The ID of the dedicated host. :return: The id, fqdn and status of all guests into a dictionary. The status...
python
def cancel_guests(self, host_id): """Cancel all guests into the dedicated host immediately. To cancel an specified guest use the method VSManager.cancel_instance() :param host_id: The ID of the dedicated host. :return: The id, fqdn and status of all guests into a dictionary. The status...
[ "def", "cancel_guests", "(", "self", ",", "host_id", ")", ":", "result", "=", "[", "]", "guests", "=", "self", ".", "host", ".", "getGuests", "(", "id", "=", "host_id", ",", "mask", "=", "'id,fullyQualifiedDomainName'", ")", "if", "guests", ":", "for", ...
Cancel all guests into the dedicated host immediately. To cancel an specified guest use the method VSManager.cancel_instance() :param host_id: The ID of the dedicated host. :return: The id, fqdn and status of all guests into a dictionary. The status could be 'Cancelled' or an ...
[ "Cancel", "all", "guests", "into", "the", "dedicated", "host", "immediately", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L54-L81
1,403
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.list_guests
def list_guests(self, host_id, tags=None, cpus=None, memory=None, hostname=None, domain=None, local_disk=None, nic_speed=None, public_ip=None, private_ip=None, **kwargs): """Retrieve a list of all virtual servers on the dedicated host. Example:: # Pr...
python
def list_guests(self, host_id, tags=None, cpus=None, memory=None, hostname=None, domain=None, local_disk=None, nic_speed=None, public_ip=None, private_ip=None, **kwargs): """Retrieve a list of all virtual servers on the dedicated host. Example:: # Pr...
[ "def", "list_guests", "(", "self", ",", "host_id", ",", "tags", "=", "None", ",", "cpus", "=", "None", ",", "memory", "=", "None", ",", "hostname", "=", "None", ",", "domain", "=", "None", ",", "local_disk", "=", "None", ",", "nic_speed", "=", "None"...
Retrieve a list of all virtual servers on the dedicated host. Example:: # Print out a list of instances with 4 cpu cores in the host id 12345. for vsi in mgr.list_guests(host_id=12345, cpus=4): print vsi['fullyQualifiedDomainName'], vsi['primaryIpAddress'] ...
[ "Retrieve", "a", "list", "of", "all", "virtual", "servers", "on", "the", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L83-L172
1,404
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.list_instances
def list_instances(self, tags=None, cpus=None, memory=None, hostname=None, disk=None, datacenter=None, **kwargs): """Retrieve a list of all dedicated hosts on the account :param list tags: filter based on list of tags :param integer cpus: filter based on number of CPUS ...
python
def list_instances(self, tags=None, cpus=None, memory=None, hostname=None, disk=None, datacenter=None, **kwargs): """Retrieve a list of all dedicated hosts on the account :param list tags: filter based on list of tags :param integer cpus: filter based on number of CPUS ...
[ "def", "list_instances", "(", "self", ",", "tags", "=", "None", ",", "cpus", "=", "None", ",", "memory", "=", "None", ",", "hostname", "=", "None", ",", "disk", "=", "None", ",", "datacenter", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", ...
Retrieve a list of all dedicated hosts on the account :param list tags: filter based on list of tags :param integer cpus: filter based on number of CPUS :param integer memory: filter based on amount of memory :param string hostname: filter based on hostname :param string disk: f...
[ "Retrieve", "a", "list", "of", "all", "dedicated", "hosts", "on", "the", "account" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L174-L228
1,405
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.get_host
def get_host(self, host_id, **kwargs): """Get details about a dedicated host. :param integer : the host ID :returns: A dictionary containing host information. Example:: # Print out host ID 12345. dh = mgr.get_host(12345) print dh # Prin...
python
def get_host(self, host_id, **kwargs): """Get details about a dedicated host. :param integer : the host ID :returns: A dictionary containing host information. Example:: # Print out host ID 12345. dh = mgr.get_host(12345) print dh # Prin...
[ "def", "get_host", "(", "self", ",", "host_id", ",", "*", "*", "kwargs", ")", ":", "if", "'mask'", "not", "in", "kwargs", ":", "kwargs", "[", "'mask'", "]", "=", "(", "'''\n id,\n name,\n cpuCount,\n memoryCa...
Get details about a dedicated host. :param integer : the host ID :returns: A dictionary containing host information. Example:: # Print out host ID 12345. dh = mgr.get_host(12345) print dh # Print out only name and backendRouter for instance 123...
[ "Get", "details", "about", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L230-L290
1,406
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.place_order
def place_order(self, hostname, domain, location, flavor, hourly, router=None): """Places an order for a dedicated host. See get_create_options() for valid arguments. :param string hostname: server hostname :param string domain: server domain name :param string location: locati...
python
def place_order(self, hostname, domain, location, flavor, hourly, router=None): """Places an order for a dedicated host. See get_create_options() for valid arguments. :param string hostname: server hostname :param string domain: server domain name :param string location: locati...
[ "def", "place_order", "(", "self", ",", "hostname", ",", "domain", ",", "location", ",", "flavor", ",", "hourly", ",", "router", "=", "None", ")", ":", "create_options", "=", "self", ".", "_generate_create_dict", "(", "hostname", "=", "hostname", ",", "rou...
Places an order for a dedicated host. See get_create_options() for valid arguments. :param string hostname: server hostname :param string domain: server domain name :param string location: location (datacenter) name :param boolean hourly: True if using hourly pricing (default)....
[ "Places", "an", "order", "for", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L292-L311
1,407
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.verify_order
def verify_order(self, hostname, domain, location, hourly, flavor, router=None): """Verifies an order for a dedicated host. See :func:`place_order` for a list of available options. """ create_options = self._generate_create_dict(hostname=hostname, ...
python
def verify_order(self, hostname, domain, location, hourly, flavor, router=None): """Verifies an order for a dedicated host. See :func:`place_order` for a list of available options. """ create_options = self._generate_create_dict(hostname=hostname, ...
[ "def", "verify_order", "(", "self", ",", "hostname", ",", "domain", ",", "location", ",", "hourly", ",", "flavor", ",", "router", "=", "None", ")", ":", "create_options", "=", "self", ".", "_generate_create_dict", "(", "hostname", "=", "hostname", ",", "ro...
Verifies an order for a dedicated host. See :func:`place_order` for a list of available options.
[ "Verifies", "an", "order", "for", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L313-L326
1,408
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager._generate_create_dict
def _generate_create_dict(self, hostname=None, domain=None, flavor=None, router=None, datacenter=None, hourly=True): """Translates a...
python
def _generate_create_dict(self, hostname=None, domain=None, flavor=None, router=None, datacenter=None, hourly=True): """Translates a...
[ "def", "_generate_create_dict", "(", "self", ",", "hostname", "=", "None", ",", "domain", "=", "None", ",", "flavor", "=", "None", ",", "router", "=", "None", ",", "datacenter", "=", "None", ",", "hourly", "=", "True", ")", ":", "package", "=", "self",...
Translates args into a dictionary for creating a dedicated host.
[ "Translates", "args", "into", "a", "dictionary", "for", "creating", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L328-L368
1,409
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.get_create_options
def get_create_options(self): """Returns valid options for ordering a dedicated host.""" package = self._get_package() # Locations locations = [] for region in package['regions']: locations.append({ 'name': region['location']['location']['longName'], ...
python
def get_create_options(self): """Returns valid options for ordering a dedicated host.""" package = self._get_package() # Locations locations = [] for region in package['regions']: locations.append({ 'name': region['location']['location']['longName'], ...
[ "def", "get_create_options", "(", "self", ")", ":", "package", "=", "self", ".", "_get_package", "(", ")", "# Locations", "locations", "=", "[", "]", "for", "region", "in", "package", "[", "'regions'", "]", ":", "locations", ".", "append", "(", "{", "'na...
Returns valid options for ordering a dedicated host.
[ "Returns", "valid", "options", "for", "ordering", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L400-L420
1,410
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager._get_price
def _get_price(self, package): """Returns valid price for ordering a dedicated host.""" for price in package['prices']: if not price.get('locationGroupId'): return price['id'] raise SoftLayer.SoftLayerError("Could not find valid price")
python
def _get_price(self, package): """Returns valid price for ordering a dedicated host.""" for price in package['prices']: if not price.get('locationGroupId'): return price['id'] raise SoftLayer.SoftLayerError("Could not find valid price")
[ "def", "_get_price", "(", "self", ",", "package", ")", ":", "for", "price", "in", "package", "[", "'prices'", "]", ":", "if", "not", "price", ".", "get", "(", "'locationGroupId'", ")", ":", "return", "price", "[", "'id'", "]", "raise", "SoftLayer", "."...
Returns valid price for ordering a dedicated host.
[ "Returns", "valid", "price", "for", "ordering", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L422-L429
1,411
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager._get_item
def _get_item(self, package, flavor): """Returns the item for ordering a dedicated host.""" for item in package['items']: if item['keyName'] == flavor: return item raise SoftLayer.SoftLayerError("Could not find valid item for: '%s'" % flavor)
python
def _get_item(self, package, flavor): """Returns the item for ordering a dedicated host.""" for item in package['items']: if item['keyName'] == flavor: return item raise SoftLayer.SoftLayerError("Could not find valid item for: '%s'" % flavor)
[ "def", "_get_item", "(", "self", ",", "package", ",", "flavor", ")", ":", "for", "item", "in", "package", "[", "'items'", "]", ":", "if", "item", "[", "'keyName'", "]", "==", "flavor", ":", "return", "item", "raise", "SoftLayer", ".", "SoftLayerError", ...
Returns the item for ordering a dedicated host.
[ "Returns", "the", "item", "for", "ordering", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L431-L438
1,412
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager._get_backend_router
def _get_backend_router(self, locations, item): """Returns valid router options for ordering a dedicated host.""" mask = ''' id, hostname ''' cpu_count = item['capacity'] for capacity in item['bundleItems']: for category in capacity['categorie...
python
def _get_backend_router(self, locations, item): """Returns valid router options for ordering a dedicated host.""" mask = ''' id, hostname ''' cpu_count = item['capacity'] for capacity in item['bundleItems']: for category in capacity['categorie...
[ "def", "_get_backend_router", "(", "self", ",", "locations", ",", "item", ")", ":", "mask", "=", "'''\n id,\n hostname\n '''", "cpu_count", "=", "item", "[", "'capacity'", "]", "for", "capacity", "in", "item", "[", "'bundleItems'", "]", ...
Returns valid router options for ordering a dedicated host.
[ "Returns", "valid", "router", "options", "for", "ordering", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L440-L498
1,413
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager._get_default_router
def _get_default_router(self, routers, router_name=None): """Returns the default router for ordering a dedicated host.""" if router_name is None: for router in routers: if router['id'] is not None: return router['id'] else: for router i...
python
def _get_default_router(self, routers, router_name=None): """Returns the default router for ordering a dedicated host.""" if router_name is None: for router in routers: if router['id'] is not None: return router['id'] else: for router i...
[ "def", "_get_default_router", "(", "self", ",", "routers", ",", "router_name", "=", "None", ")", ":", "if", "router_name", "is", "None", ":", "for", "router", "in", "routers", ":", "if", "router", "[", "'id'", "]", "is", "not", "None", ":", "return", "...
Returns the default router for ordering a dedicated host.
[ "Returns", "the", "default", "router", "for", "ordering", "a", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L500-L511
1,414
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager.get_router_options
def get_router_options(self, datacenter=None, flavor=None): """Returns available backend routers for the dedicated host.""" package = self._get_package() location = self._get_location(package['regions'], datacenter) item = self._get_item(package, flavor) return self._get_backen...
python
def get_router_options(self, datacenter=None, flavor=None): """Returns available backend routers for the dedicated host.""" package = self._get_package() location = self._get_location(package['regions'], datacenter) item = self._get_item(package, flavor) return self._get_backen...
[ "def", "get_router_options", "(", "self", ",", "datacenter", "=", "None", ",", "flavor", "=", "None", ")", ":", "package", "=", "self", ".", "_get_package", "(", ")", "location", "=", "self", ".", "_get_location", "(", "package", "[", "'regions'", "]", "...
Returns available backend routers for the dedicated host.
[ "Returns", "available", "backend", "routers", "for", "the", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L513-L520
1,415
softlayer/softlayer-python
SoftLayer/managers/dedicated_host.py
DedicatedHostManager._delete_guest
def _delete_guest(self, guest_id): """Deletes a guest and returns 'Cancelled' or and Exception message""" msg = 'Cancelled' try: self.guest.deleteObject(id=guest_id) except SoftLayer.SoftLayerAPIError as e: msg = 'Exception: ' + e.faultString return msg
python
def _delete_guest(self, guest_id): """Deletes a guest and returns 'Cancelled' or and Exception message""" msg = 'Cancelled' try: self.guest.deleteObject(id=guest_id) except SoftLayer.SoftLayerAPIError as e: msg = 'Exception: ' + e.faultString return msg
[ "def", "_delete_guest", "(", "self", ",", "guest_id", ")", ":", "msg", "=", "'Cancelled'", "try", ":", "self", ".", "guest", ".", "deleteObject", "(", "id", "=", "guest_id", ")", "except", "SoftLayer", ".", "SoftLayerAPIError", "as", "e", ":", "msg", "="...
Deletes a guest and returns 'Cancelled' or and Exception message
[ "Deletes", "a", "guest", "and", "returns", "Cancelled", "or", "and", "Exception", "message" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/dedicated_host.py#L522-L530
1,416
softlayer/softlayer-python
SoftLayer/shell/completer.py
_click_autocomplete
def _click_autocomplete(root, text): """Completer generator for click applications.""" try: parts = shlex.split(text) except ValueError: raise StopIteration location, incomplete = _click_resolve_command(root, parts) if not text.endswith(' ') and not incomplete and text: rai...
python
def _click_autocomplete(root, text): """Completer generator for click applications.""" try: parts = shlex.split(text) except ValueError: raise StopIteration location, incomplete = _click_resolve_command(root, parts) if not text.endswith(' ') and not incomplete and text: rai...
[ "def", "_click_autocomplete", "(", "root", ",", "text", ")", ":", "try", ":", "parts", "=", "shlex", ".", "split", "(", "text", ")", "except", "ValueError", ":", "raise", "StopIteration", "location", ",", "incomplete", "=", "_click_resolve_command", "(", "ro...
Completer generator for click applications.
[ "Completer", "generator", "for", "click", "applications", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/shell/completer.py#L28-L54
1,417
softlayer/softlayer-python
SoftLayer/shell/completer.py
_click_resolve_command
def _click_resolve_command(root, parts): """Return the click command and the left over text given some vargs.""" location = root incomplete = '' for part in parts: incomplete = part if not part[0:2].isalnum(): continue try: next_location = location.get_c...
python
def _click_resolve_command(root, parts): """Return the click command and the left over text given some vargs.""" location = root incomplete = '' for part in parts: incomplete = part if not part[0:2].isalnum(): continue try: next_location = location.get_c...
[ "def", "_click_resolve_command", "(", "root", ",", "parts", ")", ":", "location", "=", "root", "incomplete", "=", "''", "for", "part", "in", "parts", ":", "incomplete", "=", "part", "if", "not", "part", "[", "0", ":", "2", "]", ".", "isalnum", "(", "...
Return the click command and the left over text given some vargs.
[ "Return", "the", "click", "command", "and", "the", "left", "over", "text", "given", "some", "vargs", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/shell/completer.py#L57-L75
1,418
softlayer/softlayer-python
SoftLayer/CLI/user/edit_permissions.py
cli
def cli(env, identifier, enable, permission, from_user): """Enable or Disable specific permissions.""" mgr = SoftLayer.UserManager(env.client) user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username') result = False if from_user: from_user_id = helpers.resolve_id(mgr.resolve_ids,...
python
def cli(env, identifier, enable, permission, from_user): """Enable or Disable specific permissions.""" mgr = SoftLayer.UserManager(env.client) user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username') result = False if from_user: from_user_id = helpers.resolve_id(mgr.resolve_ids,...
[ "def", "cli", "(", "env", ",", "identifier", ",", "enable", ",", "permission", ",", "from_user", ")", ":", "mgr", "=", "SoftLayer", ".", "UserManager", "(", "env", ".", "client", ")", "user_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "reso...
Enable or Disable specific permissions.
[ "Enable", "or", "Disable", "specific", "permissions", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/edit_permissions.py#L22-L38
1,419
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.list_accounts
def list_accounts(self): """Lists CDN accounts for the active user.""" account = self.client['Account'] mask = 'cdnAccounts[%s]' % ', '.join(['id', 'createDate', 'cdnAccountName', ...
python
def list_accounts(self): """Lists CDN accounts for the active user.""" account = self.client['Account'] mask = 'cdnAccounts[%s]' % ', '.join(['id', 'createDate', 'cdnAccountName', ...
[ "def", "list_accounts", "(", "self", ")", ":", "account", "=", "self", ".", "client", "[", "'Account'", "]", "mask", "=", "'cdnAccounts[%s]'", "%", "', '", ".", "join", "(", "[", "'id'", ",", "'createDate'", ",", "'cdnAccountName'", ",", "'cdnSolutionName'",...
Lists CDN accounts for the active user.
[ "Lists", "CDN", "accounts", "for", "the", "active", "user", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L30-L40
1,420
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.get_account
def get_account(self, account_id, **kwargs): """Retrieves a CDN account with the specified account ID. :param account_id int: the numeric ID associated with the CDN account. :param dict \\*\\*kwargs: additional arguments to include in the object mask. """...
python
def get_account(self, account_id, **kwargs): """Retrieves a CDN account with the specified account ID. :param account_id int: the numeric ID associated with the CDN account. :param dict \\*\\*kwargs: additional arguments to include in the object mask. """...
[ "def", "get_account", "(", "self", ",", "account_id", ",", "*", "*", "kwargs", ")", ":", "if", "'mask'", "not", "in", "kwargs", ":", "kwargs", "[", "'mask'", "]", "=", "'status'", "return", "self", ".", "account", ".", "getObject", "(", "id", "=", "a...
Retrieves a CDN account with the specified account ID. :param account_id int: the numeric ID associated with the CDN account. :param dict \\*\\*kwargs: additional arguments to include in the object mask.
[ "Retrieves", "a", "CDN", "account", "with", "the", "specified", "account", "ID", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L42-L53
1,421
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.get_origins
def get_origins(self, account_id, **kwargs): """Retrieves list of origin pull mappings for a specified CDN account. :param account_id int: the numeric ID associated with the CDN account. :param dict \\*\\*kwargs: additional arguments to include in the object mask...
python
def get_origins(self, account_id, **kwargs): """Retrieves list of origin pull mappings for a specified CDN account. :param account_id int: the numeric ID associated with the CDN account. :param dict \\*\\*kwargs: additional arguments to include in the object mask...
[ "def", "get_origins", "(", "self", ",", "account_id", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "account", ".", "getOriginPullMappingInformation", "(", "id", "=", "account_id", ",", "*", "*", "kwargs", ")" ]
Retrieves list of origin pull mappings for a specified CDN account. :param account_id int: the numeric ID associated with the CDN account. :param dict \\*\\*kwargs: additional arguments to include in the object mask.
[ "Retrieves", "list", "of", "origin", "pull", "mappings", "for", "a", "specified", "CDN", "account", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L55-L64
1,422
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.add_origin
def add_origin(self, account_id, media_type, origin_url, cname=None, secure=False): """Adds an original pull mapping to an origin-pull. :param int account_id: the numeric ID associated with the CDN account. :param string media_type: the media type/protocol associated with thi...
python
def add_origin(self, account_id, media_type, origin_url, cname=None, secure=False): """Adds an original pull mapping to an origin-pull. :param int account_id: the numeric ID associated with the CDN account. :param string media_type: the media type/protocol associated with thi...
[ "def", "add_origin", "(", "self", ",", "account_id", ",", "media_type", ",", "origin_url", ",", "cname", "=", "None", ",", "secure", "=", "False", ")", ":", "config", "=", "{", "'mediaType'", ":", "media_type", ",", "'originUrl'", ":", "origin_url", ",", ...
Adds an original pull mapping to an origin-pull. :param int account_id: the numeric ID associated with the CDN account. :param string media_type: the media type/protocol associated with this origin pull mapping; valid values are HTTP, ...
[ "Adds", "an", "original", "pull", "mapping", "to", "an", "origin", "-", "pull", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L66-L91
1,423
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.remove_origin
def remove_origin(self, account_id, origin_id): """Removes an origin pull mapping with the given origin pull ID. :param int account_id: the CDN account ID from which the mapping should be deleted. :param int origin_id: the origin pull mapping ID to delete. ...
python
def remove_origin(self, account_id, origin_id): """Removes an origin pull mapping with the given origin pull ID. :param int account_id: the CDN account ID from which the mapping should be deleted. :param int origin_id: the origin pull mapping ID to delete. ...
[ "def", "remove_origin", "(", "self", ",", "account_id", ",", "origin_id", ")", ":", "return", "self", ".", "account", ".", "deleteOriginPullRule", "(", "origin_id", ",", "id", "=", "account_id", ")" ]
Removes an origin pull mapping with the given origin pull ID. :param int account_id: the CDN account ID from which the mapping should be deleted. :param int origin_id: the origin pull mapping ID to delete.
[ "Removes", "an", "origin", "pull", "mapping", "with", "the", "given", "origin", "pull", "ID", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L93-L101
1,424
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.load_content
def load_content(self, account_id, urls): """Prefetches one or more URLs to the CDN edge nodes. :param int account_id: the CDN account ID into which content should be preloaded. :param urls: a string or a list of strings representing the CDN URLs ...
python
def load_content(self, account_id, urls): """Prefetches one or more URLs to the CDN edge nodes. :param int account_id: the CDN account ID into which content should be preloaded. :param urls: a string or a list of strings representing the CDN URLs ...
[ "def", "load_content", "(", "self", ",", "account_id", ",", "urls", ")", ":", "if", "isinstance", "(", "urls", ",", "six", ".", "string_types", ")", ":", "urls", "=", "[", "urls", "]", "for", "i", "in", "range", "(", "0", ",", "len", "(", "urls", ...
Prefetches one or more URLs to the CDN edge nodes. :param int account_id: the CDN account ID into which content should be preloaded. :param urls: a string or a list of strings representing the CDN URLs that should be pre-loaded. :returns: true...
[ "Prefetches", "one", "or", "more", "URLs", "to", "the", "CDN", "edge", "nodes", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L103-L123
1,425
softlayer/softlayer-python
SoftLayer/managers/cdn.py
CDNManager.purge_content
def purge_content(self, account_id, urls): """Purges one or more URLs from the CDN edge nodes. :param int account_id: the CDN account ID from which content should be purged. :param urls: a string or a list of strings representing the CDN URLs ...
python
def purge_content(self, account_id, urls): """Purges one or more URLs from the CDN edge nodes. :param int account_id: the CDN account ID from which content should be purged. :param urls: a string or a list of strings representing the CDN URLs ...
[ "def", "purge_content", "(", "self", ",", "account_id", ",", "urls", ")", ":", "if", "isinstance", "(", "urls", ",", "six", ".", "string_types", ")", ":", "urls", "=", "[", "urls", "]", "content_list", "=", "[", "]", "for", "i", "in", "range", "(", ...
Purges one or more URLs from the CDN edge nodes. :param int account_id: the CDN account ID from which content should be purged. :param urls: a string or a list of strings representing the CDN URLs that should be purged. :returns: a list of Sof...
[ "Purges", "one", "or", "more", "URLs", "from", "the", "CDN", "edge", "nodes", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/cdn.py#L125-L144
1,426
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.get_lb_pkgs
def get_lb_pkgs(self): """Retrieves the local load balancer packages. :returns: A dictionary containing the load balancer packages """ _filter = {'items': {'description': utils.query_filter('*Load Balancer*')}} packages = self.prod_pkg.getItems(id=...
python
def get_lb_pkgs(self): """Retrieves the local load balancer packages. :returns: A dictionary containing the load balancer packages """ _filter = {'items': {'description': utils.query_filter('*Load Balancer*')}} packages = self.prod_pkg.getItems(id=...
[ "def", "get_lb_pkgs", "(", "self", ")", ":", "_filter", "=", "{", "'items'", ":", "{", "'description'", ":", "utils", ".", "query_filter", "(", "'*Load Balancer*'", ")", "}", "}", "packages", "=", "self", ".", "prod_pkg", ".", "getItems", "(", "id", "=",...
Retrieves the local load balancer packages. :returns: A dictionary containing the load balancer packages
[ "Retrieves", "the", "local", "load", "balancer", "packages", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L27-L41
1,427
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager._get_location
def _get_location(self, datacenter_name): """Returns the location of the specified datacenter. :param string datacenter_name: The datacenter to create the loadbalancer in :returns: the location id of the given datacenter """ datacenters =...
python
def _get_location(self, datacenter_name): """Returns the location of the specified datacenter. :param string datacenter_name: The datacenter to create the loadbalancer in :returns: the location id of the given datacenter """ datacenters =...
[ "def", "_get_location", "(", "self", ",", "datacenter_name", ")", ":", "datacenters", "=", "self", ".", "client", "[", "'Location'", "]", ".", "getDataCenters", "(", ")", "for", "datacenter", "in", "datacenters", ":", "if", "datacenter", "[", "'name'", "]", ...
Returns the location of the specified datacenter. :param string datacenter_name: The datacenter to create the loadbalancer in :returns: the location id of the given datacenter
[ "Returns", "the", "location", "of", "the", "specified", "datacenter", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L73-L86
1,428
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.cancel_lb
def cancel_lb(self, loadbal_id): """Cancels the specified load balancer. :param int loadbal_id: Load Balancer ID to be cancelled. """ lb_billing = self.lb_svc.getBillingItem(id=loadbal_id) billing_id = lb_billing['id'] billing_item = self.client['Billing_Item'] ...
python
def cancel_lb(self, loadbal_id): """Cancels the specified load balancer. :param int loadbal_id: Load Balancer ID to be cancelled. """ lb_billing = self.lb_svc.getBillingItem(id=loadbal_id) billing_id = lb_billing['id'] billing_item = self.client['Billing_Item'] ...
[ "def", "cancel_lb", "(", "self", ",", "loadbal_id", ")", ":", "lb_billing", "=", "self", ".", "lb_svc", ".", "getBillingItem", "(", "id", "=", "loadbal_id", ")", "billing_id", "=", "lb_billing", "[", "'id'", "]", "billing_item", "=", "self", ".", "client",...
Cancels the specified load balancer. :param int loadbal_id: Load Balancer ID to be cancelled.
[ "Cancels", "the", "specified", "load", "balancer", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L88-L97
1,429
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.add_local_lb
def add_local_lb(self, price_item_id, datacenter): """Creates a local load balancer in the specified data center. :param int price_item_id: The price item ID for the load balancer :param string datacenter: The datacenter to create the loadbalancer in :returns: A dictionary containing th...
python
def add_local_lb(self, price_item_id, datacenter): """Creates a local load balancer in the specified data center. :param int price_item_id: The price item ID for the load balancer :param string datacenter: The datacenter to create the loadbalancer in :returns: A dictionary containing th...
[ "def", "add_local_lb", "(", "self", ",", "price_item_id", ",", "datacenter", ")", ":", "product_order", "=", "{", "'complexType'", ":", "'SoftLayer_Container_Product_Order_Network_'", "'LoadBalancer'", ",", "'quantity'", ":", "1", ",", "'packageId'", ":", "0", ",", ...
Creates a local load balancer in the specified data center. :param int price_item_id: The price item ID for the load balancer :param string datacenter: The datacenter to create the loadbalancer in :returns: A dictionary containing the product order
[ "Creates", "a", "local", "load", "balancer", "in", "the", "specified", "data", "center", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L99-L115
1,430
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.get_local_lb
def get_local_lb(self, loadbal_id, **kwargs): """Returns a specified local load balancer given the id. :param int loadbal_id: The id of the load balancer to retrieve :returns: A dictionary containing the details of the load balancer """ if 'mask' not in kwargs: kwar...
python
def get_local_lb(self, loadbal_id, **kwargs): """Returns a specified local load balancer given the id. :param int loadbal_id: The id of the load balancer to retrieve :returns: A dictionary containing the details of the load balancer """ if 'mask' not in kwargs: kwar...
[ "def", "get_local_lb", "(", "self", ",", "loadbal_id", ",", "*", "*", "kwargs", ")", ":", "if", "'mask'", "not", "in", "kwargs", ":", "kwargs", "[", "'mask'", "]", "=", "(", "'loadBalancerHardware[datacenter], '", "'ipAddress, virtualServers[serviceGroups'", "'[ro...
Returns a specified local load balancer given the id. :param int loadbal_id: The id of the load balancer to retrieve :returns: A dictionary containing the details of the load balancer
[ "Returns", "a", "specified", "local", "load", "balancer", "given", "the", "id", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L126-L140
1,431
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.delete_service
def delete_service(self, service_id): """Deletes a service from the loadbal_id. :param int service_id: The id of the service to delete """ svc = self.client['Network_Application_Delivery_Controller_' 'LoadBalancer_Service'] return svc.deleteObject(id=...
python
def delete_service(self, service_id): """Deletes a service from the loadbal_id. :param int service_id: The id of the service to delete """ svc = self.client['Network_Application_Delivery_Controller_' 'LoadBalancer_Service'] return svc.deleteObject(id=...
[ "def", "delete_service", "(", "self", ",", "service_id", ")", ":", "svc", "=", "self", ".", "client", "[", "'Network_Application_Delivery_Controller_'", "'LoadBalancer_Service'", "]", "return", "svc", ".", "deleteObject", "(", "id", "=", "service_id", ")" ]
Deletes a service from the loadbal_id. :param int service_id: The id of the service to delete
[ "Deletes", "a", "service", "from", "the", "loadbal_id", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L142-L151
1,432
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.delete_service_group
def delete_service_group(self, group_id): """Deletes a service group from the loadbal_id. :param int group_id: The id of the service group to delete """ svc = self.client['Network_Application_Delivery_Controller_' 'LoadBalancer_VirtualServer'] return ...
python
def delete_service_group(self, group_id): """Deletes a service group from the loadbal_id. :param int group_id: The id of the service group to delete """ svc = self.client['Network_Application_Delivery_Controller_' 'LoadBalancer_VirtualServer'] return ...
[ "def", "delete_service_group", "(", "self", ",", "group_id", ")", ":", "svc", "=", "self", ".", "client", "[", "'Network_Application_Delivery_Controller_'", "'LoadBalancer_VirtualServer'", "]", "return", "svc", ".", "deleteObject", "(", "id", "=", "group_id", ")" ]
Deletes a service group from the loadbal_id. :param int group_id: The id of the service group to delete
[ "Deletes", "a", "service", "group", "from", "the", "loadbal_id", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L153-L162
1,433
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.toggle_service_status
def toggle_service_status(self, service_id): """Toggles the service status. :param int service_id: The id of the service to delete """ svc = self.client['Network_Application_Delivery_Controller_' 'LoadBalancer_Service'] return svc.toggleStatus(id=servi...
python
def toggle_service_status(self, service_id): """Toggles the service status. :param int service_id: The id of the service to delete """ svc = self.client['Network_Application_Delivery_Controller_' 'LoadBalancer_Service'] return svc.toggleStatus(id=servi...
[ "def", "toggle_service_status", "(", "self", ",", "service_id", ")", ":", "svc", "=", "self", ".", "client", "[", "'Network_Application_Delivery_Controller_'", "'LoadBalancer_Service'", "]", "return", "svc", ".", "toggleStatus", "(", "id", "=", "service_id", ")" ]
Toggles the service status. :param int service_id: The id of the service to delete
[ "Toggles", "the", "service", "status", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L164-L172
1,434
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.edit_service
def edit_service(self, loadbal_id, service_id, ip_address_id=None, port=None, enabled=None, hc_type=None, weight=None): """Edits an existing service properties. :param int loadbal_id: The id of the loadbal where the service resides :param int service_id: The id of the servi...
python
def edit_service(self, loadbal_id, service_id, ip_address_id=None, port=None, enabled=None, hc_type=None, weight=None): """Edits an existing service properties. :param int loadbal_id: The id of the loadbal where the service resides :param int service_id: The id of the servi...
[ "def", "edit_service", "(", "self", ",", "loadbal_id", ",", "service_id", ",", "ip_address_id", "=", "None", ",", "port", "=", "None", ",", "enabled", "=", "None", ",", "hc_type", "=", "None", ",", "weight", "=", "None", ")", ":", "_filter", "=", "{", ...
Edits an existing service properties. :param int loadbal_id: The id of the loadbal where the service resides :param int service_id: The id of the service to edit :param string ip_address: The ip address of the service :param int port: the port of the service :param bool enabled:...
[ "Edits", "an", "existing", "service", "properties", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L174-L214
1,435
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.add_service
def add_service(self, loadbal_id, service_group_id, ip_address_id, port=80, enabled=True, hc_type=21, weight=1): """Adds a new service to the service group. :param int loadbal_id: The id of the loadbal where the service resides :param int service_group_id: The group to add t...
python
def add_service(self, loadbal_id, service_group_id, ip_address_id, port=80, enabled=True, hc_type=21, weight=1): """Adds a new service to the service group. :param int loadbal_id: The id of the loadbal where the service resides :param int service_group_id: The group to add t...
[ "def", "add_service", "(", "self", ",", "loadbal_id", ",", "service_group_id", ",", "ip_address_id", ",", "port", "=", "80", ",", "enabled", "=", "True", ",", "hc_type", "=", "21", ",", "weight", "=", "1", ")", ":", "kwargs", "=", "utils", ".", "Nested...
Adds a new service to the service group. :param int loadbal_id: The id of the loadbal where the service resides :param int service_group_id: The group to add the service to :param int ip_address id: The ip address ID of the service :param int port: the port of the service :param...
[ "Adds", "a", "new", "service", "to", "the", "service", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L216-L254
1,436
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.add_service_group
def add_service_group(self, lb_id, allocation=100, port=80, routing_type=2, routing_method=10): """Adds a new service group to the load balancer. :param int loadbal_id: The id of the loadbal where the service resides :param int allocation: percent of connections to all...
python
def add_service_group(self, lb_id, allocation=100, port=80, routing_type=2, routing_method=10): """Adds a new service group to the load balancer. :param int loadbal_id: The id of the loadbal where the service resides :param int allocation: percent of connections to all...
[ "def", "add_service_group", "(", "self", ",", "lb_id", ",", "allocation", "=", "100", ",", "port", "=", "80", ",", "routing_type", "=", "2", ",", "routing_method", "=", "10", ")", ":", "mask", "=", "'virtualServers[serviceGroups[services[groupReferences]]]'", "l...
Adds a new service group to the load balancer. :param int loadbal_id: The id of the loadbal where the service resides :param int allocation: percent of connections to allocate toward the group :param int port: the port of the service group :param int routi...
[ "Adds", "a", "new", "service", "group", "to", "the", "load", "balancer", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L256-L282
1,437
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.edit_service_group
def edit_service_group(self, loadbal_id, group_id, allocation=None, port=None, routing_type=None, routing_method=None): """Edit an existing service group. :param int loadbal_id: The id of the loadbal where the service resides :param int group_id: The id of the service...
python
def edit_service_group(self, loadbal_id, group_id, allocation=None, port=None, routing_type=None, routing_method=None): """Edit an existing service group. :param int loadbal_id: The id of the loadbal where the service resides :param int group_id: The id of the service...
[ "def", "edit_service_group", "(", "self", ",", "loadbal_id", ",", "group_id", ",", "allocation", "=", "None", ",", "port", "=", "None", ",", "routing_type", "=", "None", ",", "routing_method", "=", "None", ")", ":", "mask", "=", "'virtualServers[serviceGroups[...
Edit an existing service group. :param int loadbal_id: The id of the loadbal where the service resides :param int group_id: The id of the service group :param int allocation: the % of connections to allocate to the group :param int port: the port of the service group :param int ...
[ "Edit", "an", "existing", "service", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L284-L314
1,438
softlayer/softlayer-python
SoftLayer/managers/load_balancer.py
LoadBalancerManager.reset_service_group
def reset_service_group(self, loadbal_id, group_id): """Resets all the connections on the service group. :param int loadbal_id: The id of the loadbal :param int group_id: The id of the service group to reset """ _filter = {'virtualServers': {'id': utils.query_filter(group_id)}}...
python
def reset_service_group(self, loadbal_id, group_id): """Resets all the connections on the service group. :param int loadbal_id: The id of the loadbal :param int group_id: The id of the service group to reset """ _filter = {'virtualServers': {'id': utils.query_filter(group_id)}}...
[ "def", "reset_service_group", "(", "self", ",", "loadbal_id", ",", "group_id", ")", ":", "_filter", "=", "{", "'virtualServers'", ":", "{", "'id'", ":", "utils", ".", "query_filter", "(", "group_id", ")", "}", "}", "virtual_servers", "=", "self", ".", "lb_...
Resets all the connections on the service group. :param int loadbal_id: The id of the loadbal :param int group_id: The id of the service group to reset
[ "Resets", "all", "the", "connections", "on", "the", "service", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/load_balancer.py#L316-L331
1,439
softlayer/softlayer-python
SoftLayer/CLI/image/detail.py
cli
def cli(env, identifier): """Get details for an image.""" image_mgr = SoftLayer.ImageManager(env.client) image_id = helpers.resolve_id(image_mgr.resolve_ids, identifier, 'image') image = image_mgr.get_image(image_id, mask=image_mod.DETAIL_MASK) disk_space = 0 datacenters = [] for child in ...
python
def cli(env, identifier): """Get details for an image.""" image_mgr = SoftLayer.ImageManager(env.client) image_id = helpers.resolve_id(image_mgr.resolve_ids, identifier, 'image') image = image_mgr.get_image(image_id, mask=image_mod.DETAIL_MASK) disk_space = 0 datacenters = [] for child in ...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "image_mgr", "=", "SoftLayer", ".", "ImageManager", "(", "env", ".", "client", ")", "image_id", "=", "helpers", ".", "resolve_id", "(", "image_mgr", ".", "resolve_ids", ",", "identifier", ",", "'image'...
Get details for an image.
[ "Get", "details", "for", "an", "image", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/detail.py#L17-L63
1,440
softlayer/softlayer-python
SoftLayer/CLI/file/snapshot/enable.py
cli
def cli(env, volume_id, schedule_type, retention_count, minute, hour, day_of_week): """Enables snapshots for a given volume on the specified schedule""" file_manager = SoftLayer.FileStorageManager(env.client) valid_schedule_types = {'INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY'} valid_days = {'SUNDAY...
python
def cli(env, volume_id, schedule_type, retention_count, minute, hour, day_of_week): """Enables snapshots for a given volume on the specified schedule""" file_manager = SoftLayer.FileStorageManager(env.client) valid_schedule_types = {'INTERVAL', 'HOURLY', 'DAILY', 'WEEKLY'} valid_days = {'SUNDAY...
[ "def", "cli", "(", "env", ",", "volume_id", ",", "schedule_type", ",", "retention_count", ",", "minute", ",", "hour", ",", "day_of_week", ")", ":", "file_manager", "=", "SoftLayer", ".", "FileStorageManager", "(", "env", ".", "client", ")", "valid_schedule_typ...
Enables snapshots for a given volume on the specified schedule
[ "Enables", "snapshots", "for", "a", "given", "volume", "on", "the", "specified", "schedule" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/enable.py#L28-L61
1,441
softlayer/softlayer-python
SoftLayer/managers/account.py
AccountManager.get_upcoming_events
def get_upcoming_events(self): """Retreives a list of Notification_Occurrence_Events that have not ended yet :return: SoftLayer_Notification_Occurrence_Event """ mask = "mask[id, subject, startDate, endDate, statusCode, acknowledgedFlag, impactedResourceCount, updateCount]" _fil...
python
def get_upcoming_events(self): """Retreives a list of Notification_Occurrence_Events that have not ended yet :return: SoftLayer_Notification_Occurrence_Event """ mask = "mask[id, subject, startDate, endDate, statusCode, acknowledgedFlag, impactedResourceCount, updateCount]" _fil...
[ "def", "get_upcoming_events", "(", "self", ")", ":", "mask", "=", "\"mask[id, subject, startDate, endDate, statusCode, acknowledgedFlag, impactedResourceCount, updateCount]\"", "_filter", "=", "{", "'endDate'", ":", "{", "'operation'", ":", "'> sysdate'", "}", ",", "'startDat...
Retreives a list of Notification_Occurrence_Events that have not ended yet :return: SoftLayer_Notification_Occurrence_Event
[ "Retreives", "a", "list", "of", "Notification_Occurrence_Events", "that", "have", "not", "ended", "yet" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/account.py#L50-L68
1,442
softlayer/softlayer-python
SoftLayer/managers/account.py
AccountManager.get_invoices
def get_invoices(self, limit=50, closed=False, get_all=False): """Gets an accounts invoices. :param int limit: Number of invoices to get back in a single call. :param bool closed: If True, will also get CLOSED invoices :param bool get_all: If True, will paginate through invoices until a...
python
def get_invoices(self, limit=50, closed=False, get_all=False): """Gets an accounts invoices. :param int limit: Number of invoices to get back in a single call. :param bool closed: If True, will also get CLOSED invoices :param bool get_all: If True, will paginate through invoices until a...
[ "def", "get_invoices", "(", "self", ",", "limit", "=", "50", ",", "closed", "=", "False", ",", "get_all", "=", "False", ")", ":", "mask", "=", "\"mask[invoiceTotalAmount, itemCount]\"", "_filter", "=", "{", "'invoices'", ":", "{", "'createDate'", ":", "{", ...
Gets an accounts invoices. :param int limit: Number of invoices to get back in a single call. :param bool closed: If True, will also get CLOSED invoices :param bool get_all: If True, will paginate through invoices until all have been retrieved. :return: Billing_Invoice
[ "Gets", "an", "accounts", "invoices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/account.py#L94-L118
1,443
softlayer/softlayer-python
SoftLayer/CLI/loadbal/create_options.py
cli
def cli(env): """Get price options to create a load balancer with.""" mgr = SoftLayer.LoadBalancerManager(env.client) table = formatting.Table(['price_id', 'capacity', 'description', 'price']) table.sortby = 'price' table.align['price'] = 'r' table.align['capacity'] = 'r' table.align['id'...
python
def cli(env): """Get price options to create a load balancer with.""" mgr = SoftLayer.LoadBalancerManager(env.client) table = formatting.Table(['price_id', 'capacity', 'description', 'price']) table.sortby = 'price' table.align['price'] = 'r' table.align['capacity'] = 'r' table.align['id'...
[ "def", "cli", "(", "env", ")", ":", "mgr", "=", "SoftLayer", ".", "LoadBalancerManager", "(", "env", ".", "client", ")", "table", "=", "formatting", ".", "Table", "(", "[", "'price_id'", ",", "'capacity'", ",", "'description'", ",", "'price'", "]", ")", ...
Get price options to create a load balancer with.
[ "Get", "price", "options", "to", "create", "a", "load", "balancer", "with", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/create_options.py#L13-L35
1,444
softlayer/softlayer-python
SoftLayer/CLI/virt/credentials.py
cli
def cli(env, identifier): """List virtual server credentials.""" vsi = SoftLayer.VSManager(env.client) vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS') instance = vsi.get_instance(vs_id) table = formatting.Table(['username', 'password']) for item in instance['operatingSystem']['pa...
python
def cli(env, identifier): """List virtual server credentials.""" vsi = SoftLayer.VSManager(env.client) vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS') instance = vsi.get_instance(vs_id) table = formatting.Table(['username', 'password']) for item in instance['operatingSystem']['pa...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "vsi", "=", "SoftLayer", ".", "VSManager", "(", "env", ".", "client", ")", "vs_id", "=", "helpers", ".", "resolve_id", "(", "vsi", ".", "resolve_ids", ",", "identifier", ",", "'VS'", ")", "instance...
List virtual server credentials.
[ "List", "virtual", "server", "credentials", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/credentials.py#L15-L25
1,445
softlayer/softlayer-python
SoftLayer/CLI/dns/record_edit.py
cli
def cli(env, zone_id, by_record, by_id, data, ttl): """Update DNS record.""" manager = SoftLayer.DNSManager(env.client) zone_id = helpers.resolve_id(manager.resolve_ids, zone_id, name='zone') results = manager.get_records(zone_id, host=by_record) for result in results: if by_id and str(res...
python
def cli(env, zone_id, by_record, by_id, data, ttl): """Update DNS record.""" manager = SoftLayer.DNSManager(env.client) zone_id = helpers.resolve_id(manager.resolve_ids, zone_id, name='zone') results = manager.get_records(zone_id, host=by_record) for result in results: if by_id and str(res...
[ "def", "cli", "(", "env", ",", "zone_id", ",", "by_record", ",", "by_id", ",", "data", ",", "ttl", ")", ":", "manager", "=", "SoftLayer", ".", "DNSManager", "(", "env", ".", "client", ")", "zone_id", "=", "helpers", ".", "resolve_id", "(", "manager", ...
Update DNS record.
[ "Update", "DNS", "record", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/record_edit.py#L21-L33
1,446
softlayer/softlayer-python
SoftLayer/CLI/hardware/ready.py
cli
def cli(env, identifier, wait): """Check if a server is ready.""" compute = SoftLayer.HardwareManager(env.client) compute_id = helpers.resolve_id(compute.resolve_ids, identifier, 'hardware') ready = compute.wait_for_ready(compute_id, wait) if ready: env.f...
python
def cli(env, identifier, wait): """Check if a server is ready.""" compute = SoftLayer.HardwareManager(env.client) compute_id = helpers.resolve_id(compute.resolve_ids, identifier, 'hardware') ready = compute.wait_for_ready(compute_id, wait) if ready: env.f...
[ "def", "cli", "(", "env", ",", "identifier", ",", "wait", ")", ":", "compute", "=", "SoftLayer", ".", "HardwareManager", "(", "env", ".", "client", ")", "compute_id", "=", "helpers", ".", "resolve_id", "(", "compute", ".", "resolve_ids", ",", "identifier",...
Check if a server is ready.
[ "Check", "if", "a", "server", "is", "ready", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/ready.py#L17-L27
1,447
softlayer/softlayer-python
SoftLayer/CLI/ticket/summary.py
cli
def cli(env): """Summary info about tickets.""" mask = ('openTicketCount, closedTicketCount, ' 'openBillingTicketCount, openOtherTicketCount, ' 'openSalesTicketCount, openSupportTicketCount, ' 'openAccountingTicketCount') account = env.client['Account'].getObject(mask=ma...
python
def cli(env): """Summary info about tickets.""" mask = ('openTicketCount, closedTicketCount, ' 'openBillingTicketCount, openOtherTicketCount, ' 'openSalesTicketCount, openSupportTicketCount, ' 'openAccountingTicketCount') account = env.client['Account'].getObject(mask=ma...
[ "def", "cli", "(", "env", ")", ":", "mask", "=", "(", "'openTicketCount, closedTicketCount, '", "'openBillingTicketCount, openOtherTicketCount, '", "'openSalesTicketCount, openSupportTicketCount, '", "'openAccountingTicketCount'", ")", "account", "=", "env", ".", "client", "[",...
Summary info about tickets.
[ "Summary", "info", "about", "tickets", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/summary.py#L12-L33
1,448
softlayer/softlayer-python
SoftLayer/CLI/globalip/list.py
cli
def cli(env, ip_version): """List all global IPs.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(['id', 'ip', 'assigned', 'target']) version = None if ip_version == 'v4': version = 4 elif ip_version == 'v6': version = 6 ips = mgr.list_global_ips(ve...
python
def cli(env, ip_version): """List all global IPs.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(['id', 'ip', 'assigned', 'target']) version = None if ip_version == 'v4': version = 4 elif ip_version == 'v6': version = 6 ips = mgr.list_global_ips(ve...
[ "def", "cli", "(", "env", ",", "ip_version", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "table", "=", "formatting", ".", "Table", "(", "[", "'id'", ",", "'ip'", ",", "'assigned'", ",", "'target'", "]", "...
List all global IPs.
[ "List", "all", "global", "IPs", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/globalip/list.py#L16-L50
1,449
softlayer/softlayer-python
SoftLayer/CLI/globalip/cancel.py
cli
def cli(env, identifier): """Cancel global IP.""" mgr = SoftLayer.NetworkManager(env.client) global_ip_id = helpers.resolve_id(mgr.resolve_global_ip_ids, identifier, name='global ip') if not (env.skip_confirmations or formatting.no_going_back(global_ip_id)): ...
python
def cli(env, identifier): """Cancel global IP.""" mgr = SoftLayer.NetworkManager(env.client) global_ip_id = helpers.resolve_id(mgr.resolve_global_ip_ids, identifier, name='global ip') if not (env.skip_confirmations or formatting.no_going_back(global_ip_id)): ...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "global_ip_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "resolve_global_ip_ids", ",", "identifier", ",", "nam...
Cancel global IP.
[ "Cancel", "global", "IP", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/globalip/cancel.py#L16-L26
1,450
softlayer/softlayer-python
SoftLayer/API.py
create_client_from_env
def create_client_from_env(username=None, api_key=None, endpoint_url=None, timeout=None, auth=None, config_file=None, proxy=None, u...
python
def create_client_from_env(username=None, api_key=None, endpoint_url=None, timeout=None, auth=None, config_file=None, proxy=None, u...
[ "def", "create_client_from_env", "(", "username", "=", "None", ",", "api_key", "=", "None", ",", "endpoint_url", "=", "None", ",", "timeout", "=", "None", ",", "auth", "=", "None", ",", "config_file", "=", "None", ",", "proxy", "=", "None", ",", "user_ag...
Creates a SoftLayer API client using your environment. Settings are loaded via keyword arguments, environemtal variables and config file. :param username: an optional API username if you wish to bypass the package's built-in username :param api_key: an optional API key if you wish to bypass th...
[ "Creates", "a", "SoftLayer", "API", "client", "using", "your", "environment", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/API.py#L41-L131
1,451
softlayer/softlayer-python
SoftLayer/API.py
BaseClient.call
def call(self, service, method, *args, **kwargs): """Make a SoftLayer API call. :param method: the method to call on the service :param \\*args: (optional) arguments for the remote call :param id: (optional) id for the resource :param mask: (optional) object mask :param ...
python
def call(self, service, method, *args, **kwargs): """Make a SoftLayer API call. :param method: the method to call on the service :param \\*args: (optional) arguments for the remote call :param id: (optional) id for the resource :param mask: (optional) object mask :param ...
[ "def", "call", "(", "self", ",", "service", ",", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", ".", "pop", "(", "'iter'", ",", "False", ")", ":", "# Most of the codebase assumes a non-generator will be returned, so casting to lis...
Make a SoftLayer API call. :param method: the method to call on the service :param \\*args: (optional) arguments for the remote call :param id: (optional) id for the resource :param mask: (optional) object mask :param dict filter: (optional) filter dict :param dict heade...
[ "Make", "a", "SoftLayer", "API", "call", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/API.py#L193-L265
1,452
softlayer/softlayer-python
SoftLayer/API.py
Service.call
def call(self, name, *args, **kwargs): """Make a SoftLayer API call :param service: the name of the SoftLayer API service :param method: the method to call on the service :param \\*args: same optional arguments that ``BaseClient.call`` takes :param \\*\\*kwargs: same optional ke...
python
def call(self, name, *args, **kwargs): """Make a SoftLayer API call :param service: the name of the SoftLayer API service :param method: the method to call on the service :param \\*args: same optional arguments that ``BaseClient.call`` takes :param \\*\\*kwargs: same optional ke...
[ "def", "call", "(", "self", ",", "name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "client", ".", "call", "(", "self", ".", "name", ",", "name", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
Make a SoftLayer API call :param service: the name of the SoftLayer API service :param method: the method to call on the service :param \\*args: same optional arguments that ``BaseClient.call`` takes :param \\*\\*kwargs: same optional keyword arguments that ``...
[ "Make", "a", "SoftLayer", "API", "call" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/API.py#L339-L357
1,453
softlayer/softlayer-python
SoftLayer/CLI/object_storage/credential/list.py
cli
def cli(env, identifier): """Retrieve credentials used for generating an AWS signature. Max of 2.""" mgr = SoftLayer.ObjectStorageManager(env.client) credential_list = mgr.list_credential(identifier) table = formatting.Table(['id', 'password', 'username', 'type_name']) for credential in credential...
python
def cli(env, identifier): """Retrieve credentials used for generating an AWS signature. Max of 2.""" mgr = SoftLayer.ObjectStorageManager(env.client) credential_list = mgr.list_credential(identifier) table = formatting.Table(['id', 'password', 'username', 'type_name']) for credential in credential...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "mgr", "=", "SoftLayer", ".", "ObjectStorageManager", "(", "env", ".", "client", ")", "credential_list", "=", "mgr", ".", "list_credential", "(", "identifier", ")", "table", "=", "formatting", ".", "Ta...
Retrieve credentials used for generating an AWS signature. Max of 2.
[ "Retrieve", "credentials", "used", "for", "generating", "an", "AWS", "signature", ".", "Max", "of", "2", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/object_storage/credential/list.py#L14-L29
1,454
softlayer/softlayer-python
SoftLayer/CLI/dedicatedhost/list.py
cli
def cli(env, sortby, cpu, columns, datacenter, name, memory, disk, tag): """List dedicated host.""" mgr = SoftLayer.DedicatedHostManager(env.client) hosts = mgr.list_instances(cpus=cpu, datacenter=datacenter, hostname=name, ...
python
def cli(env, sortby, cpu, columns, datacenter, name, memory, disk, tag): """List dedicated host.""" mgr = SoftLayer.DedicatedHostManager(env.client) hosts = mgr.list_instances(cpus=cpu, datacenter=datacenter, hostname=name, ...
[ "def", "cli", "(", "env", ",", "sortby", ",", "cpu", ",", "columns", ",", "datacenter", ",", "name", ",", "memory", ",", "disk", ",", "tag", ")", ":", "mgr", "=", "SoftLayer", ".", "DedicatedHostManager", "(", "env", ".", "client", ")", "hosts", "=",...
List dedicated host.
[ "List", "dedicated", "host", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dedicatedhost/list.py#L52-L70
1,455
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.input
def input(self, prompt, default=None, show_default=True): """Provide a command prompt.""" return click.prompt(prompt, default=default, show_default=show_default)
python
def input(self, prompt, default=None, show_default=True): """Provide a command prompt.""" return click.prompt(prompt, default=default, show_default=show_default)
[ "def", "input", "(", "self", ",", "prompt", ",", "default", "=", "None", ",", "show_default", "=", "True", ")", ":", "return", "click", ".", "prompt", "(", "prompt", ",", "default", "=", "default", ",", "show_default", "=", "show_default", ")" ]
Provide a command prompt.
[ "Provide", "a", "command", "prompt", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L58-L60
1,456
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.getpass
def getpass(self, prompt, default=None): """Provide a password prompt.""" return click.prompt(prompt, hide_input=True, default=default)
python
def getpass(self, prompt, default=None): """Provide a password prompt.""" return click.prompt(prompt, hide_input=True, default=default)
[ "def", "getpass", "(", "self", ",", "prompt", ",", "default", "=", "None", ")", ":", "return", "click", ".", "prompt", "(", "prompt", ",", "hide_input", "=", "True", ",", "default", "=", "default", ")" ]
Provide a password prompt.
[ "Provide", "a", "password", "prompt", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L62-L64
1,457
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.list_commands
def list_commands(self, *path): """Command listing.""" path_str = ':'.join(path) commands = [] for command in self.commands: # Filter based on prefix and the segment length if all([command.startswith(path_str), len(path) == command.count(":")...
python
def list_commands(self, *path): """Command listing.""" path_str = ':'.join(path) commands = [] for command in self.commands: # Filter based on prefix and the segment length if all([command.startswith(path_str), len(path) == command.count(":")...
[ "def", "list_commands", "(", "self", ",", "*", "path", ")", ":", "path_str", "=", "':'", ".", "join", "(", "path", ")", "commands", "=", "[", "]", "for", "command", "in", "self", ".", "commands", ":", "# Filter based on prefix and the segment length", "if", ...
Command listing.
[ "Command", "listing", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L67-L82
1,458
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.get_command
def get_command(self, *path): """Return command at the given path or raise error.""" path_str = ':'.join(path) if path_str in self.commands: return self.commands[path_str].load() return None
python
def get_command(self, *path): """Return command at the given path or raise error.""" path_str = ':'.join(path) if path_str in self.commands: return self.commands[path_str].load() return None
[ "def", "get_command", "(", "self", ",", "*", "path", ")", ":", "path_str", "=", "':'", ".", "join", "(", "path", ")", "if", "path_str", "in", "self", ".", "commands", ":", "return", "self", ".", "commands", "[", "path_str", "]", ".", "load", "(", "...
Return command at the given path or raise error.
[ "Return", "command", "at", "the", "given", "path", "or", "raise", "error", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L84-L91
1,459
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.resolve_alias
def resolve_alias(self, path_str): """Returns the actual command name. Uses the alias mapping.""" if path_str in self.aliases: return self.aliases[path_str] return path_str
python
def resolve_alias(self, path_str): """Returns the actual command name. Uses the alias mapping.""" if path_str in self.aliases: return self.aliases[path_str] return path_str
[ "def", "resolve_alias", "(", "self", ",", "path_str", ")", ":", "if", "path_str", "in", "self", ".", "aliases", ":", "return", "self", ".", "aliases", "[", "path_str", "]", "return", "path_str" ]
Returns the actual command name. Uses the alias mapping.
[ "Returns", "the", "actual", "command", "name", ".", "Uses", "the", "alias", "mapping", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L93-L97
1,460
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.load
def load(self): """Loads all modules.""" if self._modules_loaded is True: return self.load_modules_from_python(routes.ALL_ROUTES) self.aliases.update(routes.ALL_ALIASES) self._load_modules_from_entry_points('softlayer.cli') self._modules_loaded = True
python
def load(self): """Loads all modules.""" if self._modules_loaded is True: return self.load_modules_from_python(routes.ALL_ROUTES) self.aliases.update(routes.ALL_ALIASES) self._load_modules_from_entry_points('softlayer.cli') self._modules_loaded = True
[ "def", "load", "(", "self", ")", ":", "if", "self", ".", "_modules_loaded", "is", "True", ":", "return", "self", ".", "load_modules_from_python", "(", "routes", ".", "ALL_ROUTES", ")", "self", ".", "aliases", ".", "update", "(", "routes", ".", "ALL_ALIASES...
Loads all modules.
[ "Loads", "all", "modules", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L99-L108
1,461
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.load_modules_from_python
def load_modules_from_python(self, route_list): """Load modules from the native python source.""" for name, modpath in route_list: if ':' in modpath: path, attr = modpath.split(':', 1) else: path, attr = modpath, None self.commands[name...
python
def load_modules_from_python(self, route_list): """Load modules from the native python source.""" for name, modpath in route_list: if ':' in modpath: path, attr = modpath.split(':', 1) else: path, attr = modpath, None self.commands[name...
[ "def", "load_modules_from_python", "(", "self", ",", "route_list", ")", ":", "for", "name", ",", "modpath", "in", "route_list", ":", "if", "':'", "in", "modpath", ":", "path", ",", "attr", "=", "modpath", ".", "split", "(", "':'", ",", "1", ")", "else"...
Load modules from the native python source.
[ "Load", "modules", "from", "the", "native", "python", "source", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L110-L117
1,462
softlayer/softlayer-python
SoftLayer/CLI/environment.py
Environment.ensure_client
def ensure_client(self, config_file=None, is_demo=False, proxy=None): """Create a new SLAPI client to the environment. This will be a no-op if there is already a client in this environment. """ if self.client is not None: return # Environment can be passed in explic...
python
def ensure_client(self, config_file=None, is_demo=False, proxy=None): """Create a new SLAPI client to the environment. This will be a no-op if there is already a client in this environment. """ if self.client is not None: return # Environment can be passed in explic...
[ "def", "ensure_client", "(", "self", ",", "config_file", "=", "None", ",", "is_demo", "=", "False", ",", "proxy", "=", "None", ")", ":", "if", "self", ".", "client", "is", "not", "None", ":", "return", "# Environment can be passed in explicitly. This is used for...
Create a new SLAPI client to the environment. This will be a no-op if there is already a client in this environment.
[ "Create", "a", "new", "SLAPI", "client", "to", "the", "environment", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/environment.py#L133-L153
1,463
softlayer/softlayer-python
SoftLayer/CLI/helpers.py
multi_option
def multi_option(*param_decls, **attrs): """modify help text and indicate option is permitted multiple times :param param_decls: :param attrs: :return: """ attrhelp = attrs.get('help', None) if attrhelp is not None: newhelp = attrhelp + " (multiple occurrence permitted)" at...
python
def multi_option(*param_decls, **attrs): """modify help text and indicate option is permitted multiple times :param param_decls: :param attrs: :return: """ attrhelp = attrs.get('help', None) if attrhelp is not None: newhelp = attrhelp + " (multiple occurrence permitted)" at...
[ "def", "multi_option", "(", "*", "param_decls", ",", "*", "*", "attrs", ")", ":", "attrhelp", "=", "attrs", ".", "get", "(", "'help'", ",", "None", ")", "if", "attrhelp", "is", "not", "None", ":", "newhelp", "=", "attrhelp", "+", "\" (multiple occurrence...
modify help text and indicate option is permitted multiple times :param param_decls: :param attrs: :return:
[ "modify", "help", "text", "and", "indicate", "option", "is", "permitted", "multiple", "times" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/helpers.py#L14-L27
1,464
softlayer/softlayer-python
SoftLayer/CLI/helpers.py
resolve_id
def resolve_id(resolver, identifier, name='object'): """Resolves a single id using a resolver function. :param resolver: function that resolves ids. Should return None or a list of ids. :param string identifier: a string identifier used to resolve ids :param string name: the object type, to be used in ...
python
def resolve_id(resolver, identifier, name='object'): """Resolves a single id using a resolver function. :param resolver: function that resolves ids. Should return None or a list of ids. :param string identifier: a string identifier used to resolve ids :param string name: the object type, to be used in ...
[ "def", "resolve_id", "(", "resolver", ",", "identifier", ",", "name", "=", "'object'", ")", ":", "try", ":", "return", "int", "(", "identifier", ")", "except", "ValueError", ":", "pass", "# It was worth a shot", "ids", "=", "resolver", "(", "identifier", ")"...
Resolves a single id using a resolver function. :param resolver: function that resolves ids. Should return None or a list of ids. :param string identifier: a string identifier used to resolve ids :param string name: the object type, to be used in error messages
[ "Resolves", "a", "single", "id", "using", "a", "resolver", "function", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/helpers.py#L30-L53
1,465
softlayer/softlayer-python
SoftLayer/CLI/ssl/remove.py
cli
def cli(env, identifier): """Remove SSL certificate.""" manager = SoftLayer.SSLManager(env.client) if not (env.skip_confirmations or formatting.no_going_back('yes')): raise exceptions.CLIAbort("Aborted.") manager.remove_certificate(identifier)
python
def cli(env, identifier): """Remove SSL certificate.""" manager = SoftLayer.SSLManager(env.client) if not (env.skip_confirmations or formatting.no_going_back('yes')): raise exceptions.CLIAbort("Aborted.") manager.remove_certificate(identifier)
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "manager", "=", "SoftLayer", ".", "SSLManager", "(", "env", ".", "client", ")", "if", "not", "(", "env", ".", "skip_confirmations", "or", "formatting", ".", "no_going_back", "(", "'yes'", ")", ")", ...
Remove SSL certificate.
[ "Remove", "SSL", "certificate", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ssl/remove.py#L15-L22
1,466
softlayer/softlayer-python
SoftLayer/CLI/file/snapshot/order.py
cli
def cli(env, volume_id, capacity, tier, upgrade): """Order snapshot space for a file storage volume.""" file_manager = SoftLayer.FileStorageManager(env.client) if tier is not None: tier = float(tier) try: order = file_manager.order_snapshot_space( volume_id, cap...
python
def cli(env, volume_id, capacity, tier, upgrade): """Order snapshot space for a file storage volume.""" file_manager = SoftLayer.FileStorageManager(env.client) if tier is not None: tier = float(tier) try: order = file_manager.order_snapshot_space( volume_id, cap...
[ "def", "cli", "(", "env", ",", "volume_id", ",", "capacity", ",", "tier", ",", "upgrade", ")", ":", "file_manager", "=", "SoftLayer", ".", "FileStorageManager", "(", "env", ".", "client", ")", "if", "tier", "is", "not", "None", ":", "tier", "=", "float...
Order snapshot space for a file storage volume.
[ "Order", "snapshot", "space", "for", "a", "file", "storage", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/order.py#L27-L53
1,467
softlayer/softlayer-python
SoftLayer/CLI/virt/edit.py
cli
def cli(env, identifier, domain, userfile, tag, hostname, userdata, public_speed, private_speed): """Edit a virtual server's details.""" if userdata and userfile: raise exceptions.ArgumentError( '[-u | --userdata] not allowed with [-F | --userfile]') data = {} if userdata:...
python
def cli(env, identifier, domain, userfile, tag, hostname, userdata, public_speed, private_speed): """Edit a virtual server's details.""" if userdata and userfile: raise exceptions.ArgumentError( '[-u | --userdata] not allowed with [-F | --userfile]') data = {} if userdata:...
[ "def", "cli", "(", "env", ",", "identifier", ",", "domain", ",", "userfile", ",", "tag", ",", "hostname", ",", "userdata", ",", "public_speed", ",", "private_speed", ")", ":", "if", "userdata", "and", "userfile", ":", "raise", "exceptions", ".", "ArgumentE...
Edit a virtual server's details.
[ "Edit", "a", "virtual", "server", "s", "details", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/edit.py#L33-L64
1,468
softlayer/softlayer-python
SoftLayer/CLI/file/replication/order.py
cli
def cli(env, volume_id, snapshot_schedule, location, tier): """Order a file storage replica volume.""" file_manager = SoftLayer.FileStorageManager(env.client) if tier is not None: tier = float(tier) try: order = file_manager.order_replicant_volume( volume_id, sn...
python
def cli(env, volume_id, snapshot_schedule, location, tier): """Order a file storage replica volume.""" file_manager = SoftLayer.FileStorageManager(env.client) if tier is not None: tier = float(tier) try: order = file_manager.order_replicant_volume( volume_id, sn...
[ "def", "cli", "(", "env", ",", "volume_id", ",", "snapshot_schedule", ",", "location", ",", "tier", ")", ":", "file_manager", "=", "SoftLayer", ".", "FileStorageManager", "(", "env", ".", "client", ")", "if", "tier", "is", "not", "None", ":", "tier", "="...
Order a file storage replica volume.
[ "Order", "a", "file", "storage", "replica", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/replication/order.py#L29-L53
1,469
softlayer/softlayer-python
SoftLayer/CLI/block/replication/failback.py
cli
def cli(env, volume_id, replicant_id): """Failback a block volume from the given replicant volume.""" block_storage_manager = SoftLayer.BlockStorageManager(env.client) success = block_storage_manager.failback_from_replicant( volume_id, replicant_id ) if success: click.echo(...
python
def cli(env, volume_id, replicant_id): """Failback a block volume from the given replicant volume.""" block_storage_manager = SoftLayer.BlockStorageManager(env.client) success = block_storage_manager.failback_from_replicant( volume_id, replicant_id ) if success: click.echo(...
[ "def", "cli", "(", "env", ",", "volume_id", ",", "replicant_id", ")", ":", "block_storage_manager", "=", "SoftLayer", ".", "BlockStorageManager", "(", "env", ".", "client", ")", "success", "=", "block_storage_manager", ".", "failback_from_replicant", "(", "volume_...
Failback a block volume from the given replicant volume.
[ "Failback", "a", "block", "volume", "from", "the", "given", "replicant", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/replication/failback.py#L13-L25
1,470
softlayer/softlayer-python
SoftLayer/CLI/virt/placementgroup/detail.py
cli
def cli(env, identifier): """View details of a placement group. IDENTIFIER can be either the Name or Id of the placement group you want to view """ manager = PlacementManager(env.client) group_id = helpers.resolve_id(manager.resolve_ids, identifier, 'placement_group') result = manager.get_objec...
python
def cli(env, identifier): """View details of a placement group. IDENTIFIER can be either the Name or Id of the placement group you want to view """ manager = PlacementManager(env.client) group_id = helpers.resolve_id(manager.resolve_ids, identifier, 'placement_group') result = manager.get_objec...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "manager", "=", "PlacementManager", "(", "env", ".", "client", ")", "group_id", "=", "helpers", ".", "resolve_id", "(", "manager", ".", "resolve_ids", ",", "identifier", ",", "'placement_group'", ")", ...
View details of a placement group. IDENTIFIER can be either the Name or Id of the placement group you want to view
[ "View", "details", "of", "a", "placement", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/placementgroup/detail.py#L14-L54
1,471
softlayer/softlayer-python
SoftLayer/CLI/user/list.py
cli
def cli(env, columns): """List Users.""" mgr = SoftLayer.UserManager(env.client) users = mgr.list_users() table = formatting.Table(columns.columns) for user in users: table.add_row([value or formatting.blank() for value in columns.row(user)]) env.fout(table)
python
def cli(env, columns): """List Users.""" mgr = SoftLayer.UserManager(env.client) users = mgr.list_users() table = formatting.Table(columns.columns) for user in users: table.add_row([value or formatting.blank() for value in columns.row(user)]) env.fout(table)
[ "def", "cli", "(", "env", ",", "columns", ")", ":", "mgr", "=", "SoftLayer", ".", "UserManager", "(", "env", ".", "client", ")", "users", "=", "mgr", ".", "list_users", "(", ")", "table", "=", "formatting", ".", "Table", "(", "columns", ".", "columns...
List Users.
[ "List", "Users", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/user/list.py#L37-L48
1,472
softlayer/softlayer-python
SoftLayer/CLI/ticket/update.py
cli
def cli(env, identifier, body): """Adds an update to an existing ticket.""" mgr = SoftLayer.TicketManager(env.client) ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket') if body is None: body = click.edit('\n\n' + ticket.TEMPLATE_MSG) mgr.update_ticket(ticket_id=ticket_i...
python
def cli(env, identifier, body): """Adds an update to an existing ticket.""" mgr = SoftLayer.TicketManager(env.client) ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket') if body is None: body = click.edit('\n\n' + ticket.TEMPLATE_MSG) mgr.update_ticket(ticket_id=ticket_i...
[ "def", "cli", "(", "env", ",", "identifier", ",", "body", ")", ":", "mgr", "=", "SoftLayer", ".", "TicketManager", "(", "env", ".", "client", ")", "ticket_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "resolve_ids", ",", "identifier", ",", "...
Adds an update to an existing ticket.
[ "Adds", "an", "update", "to", "an", "existing", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/update.py#L16-L26
1,473
softlayer/softlayer-python
SoftLayer/CLI/order/quote_detail.py
cli
def cli(env, quote): """View a quote""" manager = ordering.OrderingManager(env.client) result = manager.get_quote_details(quote) package = result['order']['items'][0]['package'] title = "{} - Package: {}, Id {}".format(result.get('name'), package['keyName'], package['id']) table = formatting.T...
python
def cli(env, quote): """View a quote""" manager = ordering.OrderingManager(env.client) result = manager.get_quote_details(quote) package = result['order']['items'][0]['package'] title = "{} - Package: {}, Id {}".format(result.get('name'), package['keyName'], package['id']) table = formatting.T...
[ "def", "cli", "(", "env", ",", "quote", ")", ":", "manager", "=", "ordering", ".", "OrderingManager", "(", "env", ".", "client", ")", "result", "=", "manager", ".", "get_quote_details", "(", "quote", ")", "package", "=", "result", "[", "'order'", "]", ...
View a quote
[ "View", "a", "quote" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/order/quote_detail.py#L14-L38
1,474
softlayer/softlayer-python
SoftLayer/CLI/securitygroup/list.py
cli
def cli(env, sortby, limit): """List security groups.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(COLUMNS) table.sortby = sortby sgs = mgr.list_securitygroups(limit=limit) for secgroup in sgs: table.add_row([ secgroup['id'], secgroup....
python
def cli(env, sortby, limit): """List security groups.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(COLUMNS) table.sortby = sortby sgs = mgr.list_securitygroups(limit=limit) for secgroup in sgs: table.add_row([ secgroup['id'], secgroup....
[ "def", "cli", "(", "env", ",", "sortby", ",", "limit", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "table", "=", "formatting", ".", "Table", "(", "COLUMNS", ")", "table", ".", "sortby", "=", "sortby", "sg...
List security groups.
[ "List", "security", "groups", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/list.py#L24-L40
1,475
softlayer/softlayer-python
SoftLayer/CLI/firewall/edit.py
parse_rules
def parse_rules(content=None): """Helper to parse the input from the user into a list of rules. :param string content: the content of the editor :returns: a list of rules """ rules = content.split(DELIMITER) parsed_rules = list() order = 1 for rule in rules: if rule.strip() == '...
python
def parse_rules(content=None): """Helper to parse the input from the user into a list of rules. :param string content: the content of the editor :returns: a list of rules """ rules = content.split(DELIMITER) parsed_rules = list() order = 1 for rule in rules: if rule.strip() == '...
[ "def", "parse_rules", "(", "content", "=", "None", ")", ":", "rules", "=", "content", ".", "split", "(", "DELIMITER", ")", "parsed_rules", "=", "list", "(", ")", "order", "=", "1", "for", "rule", "in", "rules", ":", "if", "rule", ".", "strip", "(", ...
Helper to parse the input from the user into a list of rules. :param string content: the content of the editor :returns: a list of rules
[ "Helper", "to", "parse", "the", "input", "from", "the", "user", "into", "a", "list", "of", "rules", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/edit.py#L19-L60
1,476
softlayer/softlayer-python
SoftLayer/CLI/firewall/edit.py
open_editor
def open_editor(rules=None, content=None): """Helper to open an editor for editing the firewall rules. This method takes two parameters, if content is provided, that means that submitting the rules failed and we are allowing the user to re-edit what they provided. If content is not provided, the ru...
python
def open_editor(rules=None, content=None): """Helper to open an editor for editing the firewall rules. This method takes two parameters, if content is provided, that means that submitting the rules failed and we are allowing the user to re-edit what they provided. If content is not provided, the ru...
[ "def", "open_editor", "(", "rules", "=", "None", ",", "content", "=", "None", ")", ":", "# Let's get the default EDITOR of the environment,", "# use nano if none is specified", "editor", "=", "os", ".", "environ", ".", "get", "(", "'EDITOR'", ",", "'nano'", ")", "...
Helper to open an editor for editing the firewall rules. This method takes two parameters, if content is provided, that means that submitting the rules failed and we are allowing the user to re-edit what they provided. If content is not provided, the rules retrieved from the firewall will be displayed ...
[ "Helper", "to", "open", "an", "editor", "for", "editing", "the", "firewall", "rules", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/edit.py#L63-L105
1,477
softlayer/softlayer-python
SoftLayer/CLI/firewall/edit.py
get_formatted_rule
def get_formatted_rule(rule=None): """Helper to format the rule into a user friendly format. :param dict rule: A dict containing one rule of the firewall :returns: a formatted string that get be pushed into the editor """ rule = rule or {} return ('action: %s\n' 'protocol: %s\n' ...
python
def get_formatted_rule(rule=None): """Helper to format the rule into a user friendly format. :param dict rule: A dict containing one rule of the firewall :returns: a formatted string that get be pushed into the editor """ rule = rule or {} return ('action: %s\n' 'protocol: %s\n' ...
[ "def", "get_formatted_rule", "(", "rule", "=", "None", ")", ":", "rule", "=", "rule", "or", "{", "}", "return", "(", "'action: %s\\n'", "'protocol: %s\\n'", "'source_ip_address: %s\\n'", "'source_ip_subnet_mask: %s\\n'", "'destination_ip_address: %s\\n'", "'destination_ip_s...
Helper to format the rule into a user friendly format. :param dict rule: A dict containing one rule of the firewall :returns: a formatted string that get be pushed into the editor
[ "Helper", "to", "format", "the", "rule", "into", "a", "user", "friendly", "format", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/edit.py#L108-L132
1,478
softlayer/softlayer-python
SoftLayer/CLI/firewall/edit.py
cli
def cli(env, identifier): """Edit firewall rules.""" mgr = SoftLayer.FirewallManager(env.client) firewall_type, firewall_id = firewall.parse_id(identifier) if firewall_type == 'vlan': orig_rules = mgr.get_dedicated_fwl_rules(firewall_id) else: orig_rules = mgr.get_standard_fwl_rule...
python
def cli(env, identifier): """Edit firewall rules.""" mgr = SoftLayer.FirewallManager(env.client) firewall_type, firewall_id = firewall.parse_id(identifier) if firewall_type == 'vlan': orig_rules = mgr.get_dedicated_fwl_rules(firewall_id) else: orig_rules = mgr.get_standard_fwl_rule...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "mgr", "=", "SoftLayer", ".", "FirewallManager", "(", "env", ".", "client", ")", "firewall_type", ",", "firewall_id", "=", "firewall", ".", "parse_id", "(", "identifier", ")", "if", "firewall_type", "=...
Edit firewall rules.
[ "Edit", "firewall", "rules", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/edit.py#L138-L178
1,479
softlayer/softlayer-python
SoftLayer/CLI/securitygroup/rule.py
rule_list
def rule_list(env, securitygroup_id, sortby): """List security group rules.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(COLUMNS) table.sortby = sortby rules = mgr.list_securitygroup_rules(securitygroup_id) for rule in rules: port_min = rule.get('portRangeMin...
python
def rule_list(env, securitygroup_id, sortby): """List security group rules.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(COLUMNS) table.sortby = sortby rules = mgr.list_securitygroup_rules(securitygroup_id) for rule in rules: port_min = rule.get('portRangeMin...
[ "def", "rule_list", "(", "env", ",", "securitygroup_id", ",", "sortby", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "table", "=", "formatting", ".", "Table", "(", "COLUMNS", ")", "table", ".", "sortby", "=", ...
List security group rules.
[ "List", "security", "group", "rules", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/rule.py#L32-L62
1,480
softlayer/softlayer-python
SoftLayer/CLI/securitygroup/rule.py
add
def add(env, securitygroup_id, remote_ip, remote_group, direction, ethertype, port_max, port_min, protocol): """Add a security group rule to a security group. \b Examples: # Add an SSH rule (TCP port 22) to a security group slcli sg rule-add 384727 \\ --direction ingress...
python
def add(env, securitygroup_id, remote_ip, remote_group, direction, ethertype, port_max, port_min, protocol): """Add a security group rule to a security group. \b Examples: # Add an SSH rule (TCP port 22) to a security group slcli sg rule-add 384727 \\ --direction ingress...
[ "def", "add", "(", "env", ",", "securitygroup_id", ",", "remote_ip", ",", "remote_group", ",", "direction", ",", "ethertype", ",", "port_max", ",", "port_min", ",", "protocol", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "cli...
Add a security group rule to a security group. \b Examples: # Add an SSH rule (TCP port 22) to a security group slcli sg rule-add 384727 \\ --direction ingress \\ --protocol tcp \\ --port-min 22 \\ --port-max 22 \b # Add a ping rule (...
[ "Add", "a", "security", "group", "rule", "to", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/rule.py#L85-L118
1,481
softlayer/softlayer-python
SoftLayer/CLI/securitygroup/rule.py
edit
def edit(env, securitygroup_id, rule_id, remote_ip, remote_group, direction, ethertype, port_max, port_min, protocol): """Edit a security group rule in a security group.""" mgr = SoftLayer.NetworkManager(env.client) data = {} if remote_ip: data['remote_ip'] = remote_ip if remote_gr...
python
def edit(env, securitygroup_id, rule_id, remote_ip, remote_group, direction, ethertype, port_max, port_min, protocol): """Edit a security group rule in a security group.""" mgr = SoftLayer.NetworkManager(env.client) data = {} if remote_ip: data['remote_ip'] = remote_ip if remote_gr...
[ "def", "edit", "(", "env", ",", "securitygroup_id", ",", "rule_id", ",", "remote_ip", ",", "remote_group", ",", "direction", ",", "ethertype", ",", "port_max", ",", "port_min", ",", "protocol", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", ...
Edit a security group rule in a security group.
[ "Edit", "a", "security", "group", "rule", "in", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/rule.py#L139-L168
1,482
softlayer/softlayer-python
SoftLayer/CLI/securitygroup/rule.py
remove
def remove(env, securitygroup_id, rule_id): """Remove a rule from a security group.""" mgr = SoftLayer.NetworkManager(env.client) ret = mgr.remove_securitygroup_rule(securitygroup_id, rule_id) if not ret: raise exceptions.CLIAbort("Failed to remove security group rule") table = formatting...
python
def remove(env, securitygroup_id, rule_id): """Remove a rule from a security group.""" mgr = SoftLayer.NetworkManager(env.client) ret = mgr.remove_securitygroup_rule(securitygroup_id, rule_id) if not ret: raise exceptions.CLIAbort("Failed to remove security group rule") table = formatting...
[ "def", "remove", "(", "env", ",", "securitygroup_id", ",", "rule_id", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "ret", "=", "mgr", ".", "remove_securitygroup_rule", "(", "securitygroup_id", ",", "rule_id", ")",...
Remove a rule from a security group.
[ "Remove", "a", "rule", "from", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/securitygroup/rule.py#L175-L187
1,483
softlayer/softlayer-python
SoftLayer/CLI/deprecated.py
main
def main(): """Main function for the deprecated 'sl' command.""" print("ERROR: Use the 'slcli' command instead.", file=sys.stderr) print("> slcli %s" % ' '.join(sys.argv[1:]), file=sys.stderr) exit(-1)
python
def main(): """Main function for the deprecated 'sl' command.""" print("ERROR: Use the 'slcli' command instead.", file=sys.stderr) print("> slcli %s" % ' '.join(sys.argv[1:]), file=sys.stderr) exit(-1)
[ "def", "main", "(", ")", ":", "print", "(", "\"ERROR: Use the 'slcli' command instead.\"", ",", "file", "=", "sys", ".", "stderr", ")", "print", "(", "\"> slcli %s\"", "%", "' '", ".", "join", "(", "sys", ".", "argv", "[", "1", ":", "]", ")", ",", "fil...
Main function for the deprecated 'sl' command.
[ "Main", "function", "for", "the", "deprecated", "sl", "command", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/deprecated.py#L11-L15
1,484
softlayer/softlayer-python
SoftLayer/CLI/loadbal/group_edit.py
cli
def cli(env, identifier, allocation, port, routing_type, routing_method): """Edit an existing load balancer service group.""" mgr = SoftLayer.LoadBalancerManager(env.client) loadbal_id, group_id = loadbal.parse_id(identifier) # check if any input is provided if not any([allocation, port, routing_t...
python
def cli(env, identifier, allocation, port, routing_type, routing_method): """Edit an existing load balancer service group.""" mgr = SoftLayer.LoadBalancerManager(env.client) loadbal_id, group_id = loadbal.parse_id(identifier) # check if any input is provided if not any([allocation, port, routing_t...
[ "def", "cli", "(", "env", ",", "identifier", ",", "allocation", ",", "port", ",", "routing_type", ",", "routing_method", ")", ":", "mgr", "=", "SoftLayer", ".", "LoadBalancerManager", "(", "env", ".", "client", ")", "loadbal_id", ",", "group_id", "=", "loa...
Edit an existing load balancer service group.
[ "Edit", "an", "existing", "load", "balancer", "service", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/group_edit.py#L25-L43
1,485
softlayer/softlayer-python
SoftLayer/CLI/account/event_detail.py
cli
def cli(env, identifier, ack): """Details of a specific event, and ability to acknowledge event.""" # Print a list of all on going maintenance manager = AccountManager(env.client) event = manager.get_event(identifier) if ack: manager.ack_event(identifier) env.fout(basic_event_table(ev...
python
def cli(env, identifier, ack): """Details of a specific event, and ability to acknowledge event.""" # Print a list of all on going maintenance manager = AccountManager(env.client) event = manager.get_event(identifier) if ack: manager.ack_event(identifier) env.fout(basic_event_table(ev...
[ "def", "cli", "(", "env", ",", "identifier", ",", "ack", ")", ":", "# Print a list of all on going maintenance", "manager", "=", "AccountManager", "(", "env", ".", "client", ")", "event", "=", "manager", ".", "get_event", "(", "identifier", ")", "if", "ack", ...
Details of a specific event, and ability to acknowledge event.
[ "Details", "of", "a", "specific", "event", "and", "ability", "to", "acknowledge", "event", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/event_detail.py#L17-L29
1,486
softlayer/softlayer-python
SoftLayer/CLI/account/event_detail.py
basic_event_table
def basic_event_table(event): """Formats a basic event table""" table = formatting.Table(["Id", "Status", "Type", "Start", "End"], title=utils.clean_splitlines(event.get('subject'))) table.add_row([ event.get('id'), utils.lookup(event, 'statusCode', 'name'), ...
python
def basic_event_table(event): """Formats a basic event table""" table = formatting.Table(["Id", "Status", "Type", "Start", "End"], title=utils.clean_splitlines(event.get('subject'))) table.add_row([ event.get('id'), utils.lookup(event, 'statusCode', 'name'), ...
[ "def", "basic_event_table", "(", "event", ")", ":", "table", "=", "formatting", ".", "Table", "(", "[", "\"Id\"", ",", "\"Status\"", ",", "\"Type\"", ",", "\"Start\"", ",", "\"End\"", "]", ",", "title", "=", "utils", ".", "clean_splitlines", "(", "event", ...
Formats a basic event table
[ "Formats", "a", "basic", "event", "table" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/event_detail.py#L32-L45
1,487
softlayer/softlayer-python
SoftLayer/CLI/account/event_detail.py
impacted_table
def impacted_table(event): """Formats a basic impacted resources table""" table = formatting.Table([ "Type", "Id", "Hostname", "PrivateIp", "Label" ]) for item in event.get('impactedResources', []): table.add_row([ item.get('resourceType'), item.get('resourceTable...
python
def impacted_table(event): """Formats a basic impacted resources table""" table = formatting.Table([ "Type", "Id", "Hostname", "PrivateIp", "Label" ]) for item in event.get('impactedResources', []): table.add_row([ item.get('resourceType'), item.get('resourceTable...
[ "def", "impacted_table", "(", "event", ")", ":", "table", "=", "formatting", ".", "Table", "(", "[", "\"Type\"", ",", "\"Id\"", ",", "\"Hostname\"", ",", "\"PrivateIp\"", ",", "\"Label\"", "]", ")", "for", "item", "in", "event", ".", "get", "(", "'impact...
Formats a basic impacted resources table
[ "Formats", "a", "basic", "impacted", "resources", "table" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/event_detail.py#L48-L61
1,488
softlayer/softlayer-python
SoftLayer/CLI/account/event_detail.py
update_table
def update_table(event): """Formats a basic event update table""" update_number = 0 for update in event.get('updates', []): header = "======= Update #%s on %s =======" % (update_number, utils.clean_time(update.get('startDate'))) click.secho(header, fg='green') update_number = update_...
python
def update_table(event): """Formats a basic event update table""" update_number = 0 for update in event.get('updates', []): header = "======= Update #%s on %s =======" % (update_number, utils.clean_time(update.get('startDate'))) click.secho(header, fg='green') update_number = update_...
[ "def", "update_table", "(", "event", ")", ":", "update_number", "=", "0", "for", "update", "in", "event", ".", "get", "(", "'updates'", ",", "[", "]", ")", ":", "header", "=", "\"======= Update #%s on %s =======\"", "%", "(", "update_number", ",", "utils", ...
Formats a basic event update table
[ "Formats", "a", "basic", "event", "update", "table" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/account/event_detail.py#L64-L73
1,489
softlayer/softlayer-python
SoftLayer/CLI/block/list.py
cli
def cli(env, sortby, columns, datacenter, username, storage_type): """List block storage.""" block_manager = SoftLayer.BlockStorageManager(env.client) block_volumes = block_manager.list_block_volumes(datacenter=datacenter, username=username, ...
python
def cli(env, sortby, columns, datacenter, username, storage_type): """List block storage.""" block_manager = SoftLayer.BlockStorageManager(env.client) block_volumes = block_manager.list_block_volumes(datacenter=datacenter, username=username, ...
[ "def", "cli", "(", "env", ",", "sortby", ",", "columns", ",", "datacenter", ",", "username", ",", "storage_type", ")", ":", "block_manager", "=", "SoftLayer", ".", "BlockStorageManager", "(", "env", ".", "client", ")", "block_volumes", "=", "block_manager", ...
List block storage.
[ "List", "block", "storage", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/block/list.py#L67-L82
1,490
softlayer/softlayer-python
SoftLayer/CLI/object_storage/list_endpoints.py
cli
def cli(env): """List object storage endpoints.""" mgr = SoftLayer.ObjectStorageManager(env.client) endpoints = mgr.list_endpoints() table = formatting.Table(['datacenter', 'public', 'private']) for endpoint in endpoints: table.add_row([ endpoint['datacenter']['name'], ...
python
def cli(env): """List object storage endpoints.""" mgr = SoftLayer.ObjectStorageManager(env.client) endpoints = mgr.list_endpoints() table = formatting.Table(['datacenter', 'public', 'private']) for endpoint in endpoints: table.add_row([ endpoint['datacenter']['name'], ...
[ "def", "cli", "(", "env", ")", ":", "mgr", "=", "SoftLayer", ".", "ObjectStorageManager", "(", "env", ".", "client", ")", "endpoints", "=", "mgr", ".", "list_endpoints", "(", ")", "table", "=", "formatting", ".", "Table", "(", "[", "'datacenter'", ",", ...
List object storage endpoints.
[ "List", "object", "storage", "endpoints", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/object_storage/list_endpoints.py#L13-L27
1,491
softlayer/softlayer-python
SoftLayer/CLI/virt/cancel.py
cli
def cli(env, identifier): """Cancel virtual servers.""" vsi = SoftLayer.VSManager(env.client) vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS') if not (env.skip_confirmations or formatting.no_going_back(vs_id)): raise exceptions.CLIAbort('Aborted') vsi.cancel_instance(vs_id)
python
def cli(env, identifier): """Cancel virtual servers.""" vsi = SoftLayer.VSManager(env.client) vs_id = helpers.resolve_id(vsi.resolve_ids, identifier, 'VS') if not (env.skip_confirmations or formatting.no_going_back(vs_id)): raise exceptions.CLIAbort('Aborted') vsi.cancel_instance(vs_id)
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "vsi", "=", "SoftLayer", ".", "VSManager", "(", "env", ".", "client", ")", "vs_id", "=", "helpers", ".", "resolve_id", "(", "vsi", ".", "resolve_ids", ",", "identifier", ",", "'VS'", ")", "if", "...
Cancel virtual servers.
[ "Cancel", "virtual", "servers", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/cancel.py#L16-L24
1,492
softlayer/softlayer-python
SoftLayer/CLI/hardware/reflash_firmware.py
cli
def cli(env, identifier): """Reflash server firmware.""" mgr = SoftLayer.HardwareManager(env.client) hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware') if not (env.skip_confirmations or formatting.confirm('This will power off the server with id %s and ' ...
python
def cli(env, identifier): """Reflash server firmware.""" mgr = SoftLayer.HardwareManager(env.client) hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware') if not (env.skip_confirmations or formatting.confirm('This will power off the server with id %s and ' ...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "mgr", "=", "SoftLayer", ".", "HardwareManager", "(", "env", ".", "client", ")", "hw_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "resolve_ids", ",", "identifier", ",", "'hardware'", ")",...
Reflash server firmware.
[ "Reflash", "server", "firmware", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/hardware/reflash_firmware.py#L16-L26
1,493
softlayer/softlayer-python
SoftLayer/CLI/file/snapshot/schedule_list.py
cli
def cli(env, volume_id): """Lists snapshot schedules for a given volume""" file_manager = SoftLayer.FileStorageManager(env.client) snapshot_schedules = file_manager.list_volume_schedules(volume_id) table = formatting.Table(['id', 'active', '...
python
def cli(env, volume_id): """Lists snapshot schedules for a given volume""" file_manager = SoftLayer.FileStorageManager(env.client) snapshot_schedules = file_manager.list_volume_schedules(volume_id) table = formatting.Table(['id', 'active', '...
[ "def", "cli", "(", "env", ",", "volume_id", ")", ":", "file_manager", "=", "SoftLayer", ".", "FileStorageManager", "(", "env", ".", "client", ")", "snapshot_schedules", "=", "file_manager", ".", "list_volume_schedules", "(", "volume_id", ")", "table", "=", "fo...
Lists snapshot schedules for a given volume
[ "Lists", "snapshot", "schedules", "for", "a", "given", "volume" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/snapshot/schedule_list.py#L13-L70
1,494
softlayer/softlayer-python
SoftLayer/CLI/firewall/list.py
cli
def cli(env): """List firewalls.""" mgr = SoftLayer.FirewallManager(env.client) table = formatting.Table(['firewall id', 'type', 'features', 'server/vlan id']) fwvlans = mgr.get_firewalls() dedicated_firewalls...
python
def cli(env): """List firewalls.""" mgr = SoftLayer.FirewallManager(env.client) table = formatting.Table(['firewall id', 'type', 'features', 'server/vlan id']) fwvlans = mgr.get_firewalls() dedicated_firewalls...
[ "def", "cli", "(", "env", ")", ":", "mgr", "=", "SoftLayer", ".", "FirewallManager", "(", "env", ".", "client", ")", "table", "=", "formatting", ".", "Table", "(", "[", "'firewall id'", ",", "'type'", ",", "'features'", ",", "'server/vlan id'", "]", ")",...
List firewalls.
[ "List", "firewalls", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/firewall/list.py#L14-L73
1,495
softlayer/softlayer-python
SoftLayer/CLI/subnet/cancel.py
cli
def cli(env, identifier): """Cancel a subnet.""" mgr = SoftLayer.NetworkManager(env.client) subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier, name='subnet') if not (env.skip_confirmations or formatting.no_going_back(subnet_id)): raise excepti...
python
def cli(env, identifier): """Cancel a subnet.""" mgr = SoftLayer.NetworkManager(env.client) subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier, name='subnet') if not (env.skip_confirmations or formatting.no_going_back(subnet_id)): raise excepti...
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "subnet_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "resolve_subnet_ids", ",", "identifier", ",", "name", ...
Cancel a subnet.
[ "Cancel", "a", "subnet", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/cancel.py#L16-L26
1,496
softlayer/softlayer-python
SoftLayer/CLI/config/__init__.py
get_settings_from_client
def get_settings_from_client(client): """Pull out settings from a SoftLayer.BaseClient instance. :param client: SoftLayer.BaseClient instance """ settings = { 'username': '', 'api_key': '', 'timeout': '', 'endpoint_url': '', } try: settings['username'] = ...
python
def get_settings_from_client(client): """Pull out settings from a SoftLayer.BaseClient instance. :param client: SoftLayer.BaseClient instance """ settings = { 'username': '', 'api_key': '', 'timeout': '', 'endpoint_url': '', } try: settings['username'] = ...
[ "def", "get_settings_from_client", "(", "client", ")", ":", "settings", "=", "{", "'username'", ":", "''", ",", "'api_key'", ":", "''", ",", "'timeout'", ":", "''", ",", "'endpoint_url'", ":", "''", ",", "}", "try", ":", "settings", "[", "'username'", "]...
Pull out settings from a SoftLayer.BaseClient instance. :param client: SoftLayer.BaseClient instance
[ "Pull", "out", "settings", "from", "a", "SoftLayer", ".", "BaseClient", "instance", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/config/__init__.py#L16-L40
1,497
softlayer/softlayer-python
SoftLayer/CLI/config/__init__.py
config_table
def config_table(settings): """Returns a config table.""" table = formatting.KeyValueTable(['name', 'value']) table.align['name'] = 'r' table.align['value'] = 'l' table.add_row(['Username', settings['username'] or 'not set']) table.add_row(['API Key', settings['api_key'] or 'not set']) table...
python
def config_table(settings): """Returns a config table.""" table = formatting.KeyValueTable(['name', 'value']) table.align['name'] = 'r' table.align['value'] = 'l' table.add_row(['Username', settings['username'] or 'not set']) table.add_row(['API Key', settings['api_key'] or 'not set']) table...
[ "def", "config_table", "(", "settings", ")", ":", "table", "=", "formatting", ".", "KeyValueTable", "(", "[", "'name'", ",", "'value'", "]", ")", "table", ".", "align", "[", "'name'", "]", "=", "'r'", "table", ".", "align", "[", "'value'", "]", "=", ...
Returns a config table.
[ "Returns", "a", "config", "table", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/config/__init__.py#L43-L52
1,498
softlayer/softlayer-python
SoftLayer/CLI/virt/capacity/create.py
cli
def cli(env, name, backend_router_id, flavor, instances, test=False): """Create a Reserved Capacity instance. *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired. """ manager = CapacityManager(env.client) result = manager.create( name=name,...
python
def cli(env, name, backend_router_id, flavor, instances, test=False): """Create a Reserved Capacity instance. *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired. """ manager = CapacityManager(env.client) result = manager.create( name=name,...
[ "def", "cli", "(", "env", ",", "name", ",", "backend_router_id", ",", "flavor", ",", "instances", ",", "test", "=", "False", ")", ":", "manager", "=", "CapacityManager", "(", "env", ".", "client", ")", "result", "=", "manager", ".", "create", "(", "nam...
Create a Reserved Capacity instance. *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired.
[ "Create", "a", "Reserved", "Capacity", "instance", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/virt/capacity/create.py#L24-L51
1,499
softlayer/softlayer-python
SoftLayer/CLI/cdn/origin_list.py
cli
def cli(env, account_id): """List origin pull mappings.""" manager = SoftLayer.CDNManager(env.client) origins = manager.get_origins(account_id) table = formatting.Table(['id', 'media_type', 'cname', 'origin_url']) for origin in origins: table.add_row([origin['id'], ...
python
def cli(env, account_id): """List origin pull mappings.""" manager = SoftLayer.CDNManager(env.client) origins = manager.get_origins(account_id) table = formatting.Table(['id', 'media_type', 'cname', 'origin_url']) for origin in origins: table.add_row([origin['id'], ...
[ "def", "cli", "(", "env", ",", "account_id", ")", ":", "manager", "=", "SoftLayer", ".", "CDNManager", "(", "env", ".", "client", ")", "origins", "=", "manager", ".", "get_origins", "(", "account_id", ")", "table", "=", "formatting", ".", "Table", "(", ...
List origin pull mappings.
[ "List", "origin", "pull", "mappings", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/cdn/origin_list.py#L14-L28