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
partition
stringclasses
1 value
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.order_duplicate_volume
def order_duplicate_volume(self, origin_volume_id, origin_snapshot_id=None, duplicate_size=None, duplicate_iops=None, duplicate_tier_level=None, duplicate_snapshot_size=None, hourly_billing_flag=F...
python
def order_duplicate_volume(self, origin_volume_id, origin_snapshot_id=None, duplicate_size=None, duplicate_iops=None, duplicate_tier_level=None, duplicate_snapshot_size=None, hourly_billing_flag=F...
[ "def", "order_duplicate_volume", "(", "self", ",", "origin_volume_id", ",", "origin_snapshot_id", "=", "None", ",", "duplicate_size", "=", "None", ",", "duplicate_iops", "=", "None", ",", "duplicate_tier_level", "=", "None", ",", "duplicate_snapshot_size", "=", "Non...
Places an order for a duplicate block volume. :param origin_volume_id: The ID of the origin volume to be duplicated :param origin_snapshot_id: Origin snapshot ID to use for duplication :param duplicate_size: Size/capacity for the duplicate volume :param duplicate_iops: The IOPS per GB f...
[ "Places", "an", "order", "for", "a", "duplicate", "block", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L262-L304
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.order_modified_volume
def order_modified_volume(self, volume_id, new_size=None, new_iops=None, new_tier_level=None): """Places an order for modifying an existing block volume. :param volume_id: The ID of the volume to be modified :param new_size: The new size/capacity for the volume :param new_iops: The new ...
python
def order_modified_volume(self, volume_id, new_size=None, new_iops=None, new_tier_level=None): """Places an order for modifying an existing block volume. :param volume_id: The ID of the volume to be modified :param new_size: The new size/capacity for the volume :param new_iops: The new ...
[ "def", "order_modified_volume", "(", "self", ",", "volume_id", ",", "new_size", "=", "None", ",", "new_iops", "=", "None", ",", "new_tier_level", "=", "None", ")", ":", "mask_items", "=", "[", "'id'", ",", "'billingItem'", ",", "'storageType[keyName]'", ",", ...
Places an order for modifying an existing block volume. :param volume_id: The ID of the volume to be modified :param new_size: The new size/capacity for the volume :param new_iops: The new IOPS for the volume :param new_tier_level: The new tier level for the volume :return: Retu...
[ "Places", "an", "order", "for", "modifying", "an", "existing", "block", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L306-L333
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.order_block_volume
def order_block_volume(self, storage_type, location, size, os_type, iops=None, tier_level=None, snapshot_size=None, service_offering='storage_as_a_service', hourly_billing_flag=False): """Places an order for a block volume. ...
python
def order_block_volume(self, storage_type, location, size, os_type, iops=None, tier_level=None, snapshot_size=None, service_offering='storage_as_a_service', hourly_billing_flag=False): """Places an order for a block volume. ...
[ "def", "order_block_volume", "(", "self", ",", "storage_type", ",", "location", ",", "size", ",", "os_type", ",", "iops", "=", "None", ",", "tier_level", "=", "None", ",", "snapshot_size", "=", "None", ",", "service_offering", "=", "'storage_as_a_service'", ",...
Places an order for a block volume. :param storage_type: 'performance' or 'endurance' :param location: Datacenter in which to order iSCSI volume :param size: Size of the desired volume, in GB :param os_type: OS Type to use for volume alignment, see help for list :param iops: Num...
[ "Places", "an", "order", "for", "a", "block", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L343-L369
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.create_snapshot
def create_snapshot(self, volume_id, notes='', **kwargs): """Creates a snapshot on the given block volume. :param integer volume_id: The id of the volume :param string notes: The notes or "name" to assign the snapshot :return: Returns the id of the new snapshot """ retu...
python
def create_snapshot(self, volume_id, notes='', **kwargs): """Creates a snapshot on the given block volume. :param integer volume_id: The id of the volume :param string notes: The notes or "name" to assign the snapshot :return: Returns the id of the new snapshot """ retu...
[ "def", "create_snapshot", "(", "self", ",", "volume_id", ",", "notes", "=", "''", ",", "**", "kwargs", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'createSnapshot'", ",", "notes", ",", "id", "=", "volume_id", "...
Creates a snapshot on the given block volume. :param integer volume_id: The id of the volume :param string notes: The notes or "name" to assign the snapshot :return: Returns the id of the new snapshot
[ "Creates", "a", "snapshot", "on", "the", "given", "block", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L371-L380
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.order_snapshot_space
def order_snapshot_space(self, volume_id, capacity, tier, upgrade, **kwargs): """Orders snapshot space for the given block volume. :param integer volume_id: The id of the volume :param integer capacity: The capacity to order, in GB :param float tier: The tie...
python
def order_snapshot_space(self, volume_id, capacity, tier, upgrade, **kwargs): """Orders snapshot space for the given block volume. :param integer volume_id: The id of the volume :param integer capacity: The capacity to order, in GB :param float tier: The tie...
[ "def", "order_snapshot_space", "(", "self", ",", "volume_id", ",", "capacity", ",", "tier", ",", "upgrade", ",", "**", "kwargs", ")", ":", "block_mask", "=", "'id,billingItem[location,hourlyFlag],'", "'storageType[keyName],storageTierLevel,provisionedIops,'", "'staasVersion...
Orders snapshot space for the given block volume. :param integer volume_id: The id of the volume :param integer capacity: The capacity to order, in GB :param float tier: The tier level of the block volume, in IOPS per GB :param boolean upgrade: Flag to indicate if this order is an upgra...
[ "Orders", "snapshot", "space", "for", "the", "given", "block", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L382-L402
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.enable_snapshots
def enable_snapshots(self, volume_id, schedule_type, retention_count, minute, hour, day_of_week, **kwargs): """Enables snapshots for a specific block volume at a given schedule :param integer volume_id: The id of the volume :param string schedule_type: 'HOURLY'|'DAILY'|...
python
def enable_snapshots(self, volume_id, schedule_type, retention_count, minute, hour, day_of_week, **kwargs): """Enables snapshots for a specific block volume at a given schedule :param integer volume_id: The id of the volume :param string schedule_type: 'HOURLY'|'DAILY'|...
[ "def", "enable_snapshots", "(", "self", ",", "volume_id", ",", "schedule_type", ",", "retention_count", ",", "minute", ",", "hour", ",", "day_of_week", ",", "**", "kwargs", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ","...
Enables snapshots for a specific block volume at a given schedule :param integer volume_id: The id of the volume :param string schedule_type: 'HOURLY'|'DAILY'|'WEEKLY' :param integer retention_count: Number of snapshots to be kept :param integer minute: Minute when to take snapshot ...
[ "Enables", "snapshots", "for", "a", "specific", "block", "volume", "at", "a", "given", "schedule" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L443-L463
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.disable_snapshots
def disable_snapshots(self, volume_id, schedule_type): """Disables snapshots for a specific block volume at a given schedule :param integer volume_id: The id of the volume :param string schedule_type: 'HOURLY'|'DAILY'|'WEEKLY' :return: Returns whether successfully disabled or not ...
python
def disable_snapshots(self, volume_id, schedule_type): """Disables snapshots for a specific block volume at a given schedule :param integer volume_id: The id of the volume :param string schedule_type: 'HOURLY'|'DAILY'|'WEEKLY' :return: Returns whether successfully disabled or not ...
[ "def", "disable_snapshots", "(", "self", ",", "volume_id", ",", "schedule_type", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'disableSnapshots'", ",", "schedule_type", ",", "id", "=", "volume_id", ")" ]
Disables snapshots for a specific block volume at a given schedule :param integer volume_id: The id of the volume :param string schedule_type: 'HOURLY'|'DAILY'|'WEEKLY' :return: Returns whether successfully disabled or not
[ "Disables", "snapshots", "for", "a", "specific", "block", "volume", "at", "a", "given", "schedule" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L465-L474
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.list_volume_schedules
def list_volume_schedules(self, volume_id): """Lists schedules for a given volume :param integer volume_id: The id of the volume :return: Returns list of schedules assigned to a given volume """ volume_detail = self.client.call( 'Network_Storage', 'getObj...
python
def list_volume_schedules(self, volume_id): """Lists schedules for a given volume :param integer volume_id: The id of the volume :return: Returns list of schedules assigned to a given volume """ volume_detail = self.client.call( 'Network_Storage', 'getObj...
[ "def", "list_volume_schedules", "(", "self", ",", "volume_id", ")", ":", "volume_detail", "=", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'getObject'", ",", "id", "=", "volume_id", ",", "mask", "=", "'schedules[type,properties[type]]'", ...
Lists schedules for a given volume :param integer volume_id: The id of the volume :return: Returns list of schedules assigned to a given volume
[ "Lists", "schedules", "for", "a", "given", "volume" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L476-L488
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.restore_from_snapshot
def restore_from_snapshot(self, volume_id, snapshot_id): """Restores a specific volume from a snapshot :param integer volume_id: The id of the volume :param integer snapshot_id: The id of the restore point :return: Returns whether succesfully restored or not """ return ...
python
def restore_from_snapshot(self, volume_id, snapshot_id): """Restores a specific volume from a snapshot :param integer volume_id: The id of the volume :param integer snapshot_id: The id of the restore point :return: Returns whether succesfully restored or not """ return ...
[ "def", "restore_from_snapshot", "(", "self", ",", "volume_id", ",", "snapshot_id", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'restoreFromSnapshot'", ",", "snapshot_id", ",", "id", "=", "volume_id", ")" ]
Restores a specific volume from a snapshot :param integer volume_id: The id of the volume :param integer snapshot_id: The id of the restore point :return: Returns whether succesfully restored or not
[ "Restores", "a", "specific", "volume", "from", "a", "snapshot" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L490-L499
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.cancel_block_volume
def cancel_block_volume(self, volume_id, reason='No longer needed', immediate=False): """Cancels the given block storage volume. :param integer volume_id: The volume ID :param string reason: The reason for cancellation :param boole...
python
def cancel_block_volume(self, volume_id, reason='No longer needed', immediate=False): """Cancels the given block storage volume. :param integer volume_id: The volume ID :param string reason: The reason for cancellation :param boole...
[ "def", "cancel_block_volume", "(", "self", ",", "volume_id", ",", "reason", "=", "'No longer needed'", ",", "immediate", "=", "False", ")", ":", "block_volume", "=", "self", ".", "get_block_volume_details", "(", "volume_id", ",", "mask", "=", "'mask[id,billingItem...
Cancels the given block storage volume. :param integer volume_id: The volume ID :param string reason: The reason for cancellation :param boolean immediate_flag: Cancel immediately or on anniversary date
[ "Cancels", "the", "given", "block", "storage", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L501-L526
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.failover_to_replicant
def failover_to_replicant(self, volume_id, replicant_id, immediate=False): """Failover to a volume replicant. :param integer volume_id: The id of the volume :param integer replicant_id: ID of replicant to failover to :param boolean immediate: Flag indicating if failover is immediate ...
python
def failover_to_replicant(self, volume_id, replicant_id, immediate=False): """Failover to a volume replicant. :param integer volume_id: The id of the volume :param integer replicant_id: ID of replicant to failover to :param boolean immediate: Flag indicating if failover is immediate ...
[ "def", "failover_to_replicant", "(", "self", ",", "volume_id", ",", "replicant_id", ",", "immediate", "=", "False", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'failoverToReplicant'", ",", "replicant_id", ",", "immedia...
Failover to a volume replicant. :param integer volume_id: The id of the volume :param integer replicant_id: ID of replicant to failover to :param boolean immediate: Flag indicating if failover is immediate :return: Returns whether failover was successful or not
[ "Failover", "to", "a", "volume", "replicant", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L528-L538
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.failback_from_replicant
def failback_from_replicant(self, volume_id, replicant_id): """Failback from a volume replicant. :param integer volume_id: The id of the volume :param integer replicant_id: ID of replicant to failback from :return: Returns whether failback was successful or not """ retu...
python
def failback_from_replicant(self, volume_id, replicant_id): """Failback from a volume replicant. :param integer volume_id: The id of the volume :param integer replicant_id: ID of replicant to failback from :return: Returns whether failback was successful or not """ retu...
[ "def", "failback_from_replicant", "(", "self", ",", "volume_id", ",", "replicant_id", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'failbackFromReplicant'", ",", "replicant_id", ",", "id", "=", "volume_id", ")" ]
Failback from a volume replicant. :param integer volume_id: The id of the volume :param integer replicant_id: ID of replicant to failback from :return: Returns whether failback was successful or not
[ "Failback", "from", "a", "volume", "replicant", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L540-L549
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.set_credential_password
def set_credential_password(self, access_id, password): """Sets the password for an access host :param integer access_id: id of the access host :param string password: password to set """ return self.client.call('Network_Storage_Allowed_Host', 'setCredentialPassword', ...
python
def set_credential_password(self, access_id, password): """Sets the password for an access host :param integer access_id: id of the access host :param string password: password to set """ return self.client.call('Network_Storage_Allowed_Host', 'setCredentialPassword', ...
[ "def", "set_credential_password", "(", "self", ",", "access_id", ",", "password", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage_Allowed_Host'", ",", "'setCredentialPassword'", ",", "password", ",", "id", "=", "access_id", ")" ]
Sets the password for an access host :param integer access_id: id of the access host :param string password: password to set
[ "Sets", "the", "password", "for", "an", "access", "host" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L551-L559
train
softlayer/softlayer-python
SoftLayer/managers/block.py
BlockStorageManager.create_or_update_lun_id
def create_or_update_lun_id(self, volume_id, lun_id): """Set the LUN ID on a volume. :param integer volume_id: The id of the volume :param integer lun_id: LUN ID to set on the volume :return: a SoftLayer_Network_Storage_Property object """ return self.client.call('Networ...
python
def create_or_update_lun_id(self, volume_id, lun_id): """Set the LUN ID on a volume. :param integer volume_id: The id of the volume :param integer lun_id: LUN ID to set on the volume :return: a SoftLayer_Network_Storage_Property object """ return self.client.call('Networ...
[ "def", "create_or_update_lun_id", "(", "self", ",", "volume_id", ",", "lun_id", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'Network_Storage'", ",", "'createOrUpdateLunId'", ",", "lun_id", ",", "id", "=", "volume_id", ")" ]
Set the LUN ID on a volume. :param integer volume_id: The id of the volume :param integer lun_id: LUN ID to set on the volume :return: a SoftLayer_Network_Storage_Property object
[ "Set", "the", "LUN", "ID", "on", "a", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/block.py#L561-L569
train
softlayer/softlayer-python
SoftLayer/CLI/summary.py
cli
def cli(env, sortby): """Account summary.""" mgr = SoftLayer.NetworkManager(env.client) datacenters = mgr.summary_by_datacenter() table = formatting.Table(COLUMNS) table.sortby = sortby for name, datacenter in datacenters.items(): table.add_row([ name, datacent...
python
def cli(env, sortby): """Account summary.""" mgr = SoftLayer.NetworkManager(env.client) datacenters = mgr.summary_by_datacenter() table = formatting.Table(COLUMNS) table.sortby = sortby for name, datacenter in datacenters.items(): table.add_row([ name, datacent...
[ "def", "cli", "(", "env", ",", "sortby", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "datacenters", "=", "mgr", ".", "summary_by_datacenter", "(", ")", "table", "=", "formatting", ".", "Table", "(", "COLUMNS"...
Account summary.
[ "Account", "summary", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/summary.py#L25-L44
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_packages_of_type
def get_packages_of_type(self, package_types, mask=None): """Get packages that match a certain type. Each ordering package has a type, so return all packages that match the types we are looking for :param list package_types: List of strings representing the package ...
python
def get_packages_of_type(self, package_types, mask=None): """Get packages that match a certain type. Each ordering package has a type, so return all packages that match the types we are looking for :param list package_types: List of strings representing the package ...
[ "def", "get_packages_of_type", "(", "self", ",", "package_types", ",", "mask", "=", "None", ")", ":", "_filter", "=", "{", "'type'", ":", "{", "'keyName'", ":", "{", "'operation'", ":", "'in'", ",", "'options'", ":", "[", "{", "'name'", ":", "'data'", ...
Get packages that match a certain type. Each ordering package has a type, so return all packages that match the types we are looking for :param list package_types: List of strings representing the package type keynames we are interested in. :param str...
[ "Get", "packages", "that", "match", "a", "certain", "type", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L40-L65
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.filter_outlet_packages
def filter_outlet_packages(packages): """Remove packages designated as OUTLET. Those type of packages must be handled in a different way, and they are not supported at the moment. :param packages: Dictionary of packages. Name and description keys must be presen...
python
def filter_outlet_packages(packages): """Remove packages designated as OUTLET. Those type of packages must be handled in a different way, and they are not supported at the moment. :param packages: Dictionary of packages. Name and description keys must be presen...
[ "def", "filter_outlet_packages", "(", "packages", ")", ":", "non_outlet_packages", "=", "[", "]", "for", "package", "in", "packages", ":", "if", "all", "(", "[", "'OUTLET'", "not", "in", "package", ".", "get", "(", "'description'", ",", "''", ")", ".", "...
Remove packages designated as OUTLET. Those type of packages must be handled in a different way, and they are not supported at the moment. :param packages: Dictionary of packages. Name and description keys must be present in each of them.
[ "Remove", "packages", "designated", "as", "OUTLET", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L68-L85
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_only_active_packages
def get_only_active_packages(packages): """Return only active packages. If a package is active, it is eligible for ordering This will inspect the 'isActive' property on the provided packages :param packages: Dictionary of packages, isActive key must be present """ acti...
python
def get_only_active_packages(packages): """Return only active packages. If a package is active, it is eligible for ordering This will inspect the 'isActive' property on the provided packages :param packages: Dictionary of packages, isActive key must be present """ acti...
[ "def", "get_only_active_packages", "(", "packages", ")", ":", "active_packages", "=", "[", "]", "for", "package", "in", "packages", ":", "if", "package", "[", "'isActive'", "]", ":", "active_packages", ".", "append", "(", "package", ")", "return", "active_pack...
Return only active packages. If a package is active, it is eligible for ordering This will inspect the 'isActive' property on the provided packages :param packages: Dictionary of packages, isActive key must be present
[ "Return", "only", "active", "packages", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L88-L103
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_package_by_type
def get_package_by_type(self, package_type, mask=None): """Get a single package of a given type. Syntactic sugar to retrieve a single package of a given type. If multiple packages share the given type, this will return the first one returned by the API. If no packages are found,...
python
def get_package_by_type(self, package_type, mask=None): """Get a single package of a given type. Syntactic sugar to retrieve a single package of a given type. If multiple packages share the given type, this will return the first one returned by the API. If no packages are found,...
[ "def", "get_package_by_type", "(", "self", ",", "package_type", ",", "mask", "=", "None", ")", ":", "packages", "=", "self", ".", "get_packages_of_type", "(", "[", "package_type", "]", ",", "mask", ")", "if", "len", "(", "packages", ")", "==", "0", ":", ...
Get a single package of a given type. Syntactic sugar to retrieve a single package of a given type. If multiple packages share the given type, this will return the first one returned by the API. If no packages are found, returns None :param string package_type: representing the...
[ "Get", "a", "single", "package", "of", "a", "given", "type", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L105-L119
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_package_id_by_type
def get_package_id_by_type(self, package_type): """Return the package ID of a Product Package with a given type. :param string package_type: representing the package type key name we are interested in :raises ValueError: when no package of the given type is found """ mask = "ma...
python
def get_package_id_by_type(self, package_type): """Return the package ID of a Product Package with a given type. :param string package_type: representing the package type key name we are interested in :raises ValueError: when no package of the given type is found """ mask = "ma...
[ "def", "get_package_id_by_type", "(", "self", ",", "package_type", ")", ":", "mask", "=", "\"mask[id, name, description, isActive, type[keyName]]\"", "package", "=", "self", ".", "get_package_by_type", "(", "package_type", ",", "mask", ")", "if", "package", ":", "retu...
Return the package ID of a Product Package with a given type. :param string package_type: representing the package type key name we are interested in :raises ValueError: when no package of the given type is found
[ "Return", "the", "package", "ID", "of", "a", "Product", "Package", "with", "a", "given", "type", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L121-L133
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_quotes
def get_quotes(self): """Retrieve a list of active quotes. :returns: a list of SoftLayer_Billing_Order_Quote """ mask = "mask[order[id,items[id,package[id,keyName]]]]" quotes = self.client['Account'].getActiveQuotes(mask=mask) return quotes
python
def get_quotes(self): """Retrieve a list of active quotes. :returns: a list of SoftLayer_Billing_Order_Quote """ mask = "mask[order[id,items[id,package[id,keyName]]]]" quotes = self.client['Account'].getActiveQuotes(mask=mask) return quotes
[ "def", "get_quotes", "(", "self", ")", ":", "mask", "=", "\"mask[order[id,items[id,package[id,keyName]]]]\"", "quotes", "=", "self", ".", "client", "[", "'Account'", "]", ".", "getActiveQuotes", "(", "mask", "=", "mask", ")", "return", "quotes" ]
Retrieve a list of active quotes. :returns: a list of SoftLayer_Billing_Order_Quote
[ "Retrieve", "a", "list", "of", "active", "quotes", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L135-L142
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_quote_details
def get_quote_details(self, quote_id): """Retrieve quote details. :param quote_id: ID number of target quote """ mask = "mask[order[id,items[package[id,keyName]]]]" quote = self.client['Billing_Order_Quote'].getObject(id=quote_id, mask=mask) return quote
python
def get_quote_details(self, quote_id): """Retrieve quote details. :param quote_id: ID number of target quote """ mask = "mask[order[id,items[package[id,keyName]]]]" quote = self.client['Billing_Order_Quote'].getObject(id=quote_id, mask=mask) return quote
[ "def", "get_quote_details", "(", "self", ",", "quote_id", ")", ":", "mask", "=", "\"mask[order[id,items[package[id,keyName]]]]\"", "quote", "=", "self", ".", "client", "[", "'Billing_Order_Quote'", "]", ".", "getObject", "(", "id", "=", "quote_id", ",", "mask", ...
Retrieve quote details. :param quote_id: ID number of target quote
[ "Retrieve", "quote", "details", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L144-L152
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_order_container
def get_order_container(self, quote_id): """Generate an order container from a quote object. :param quote_id: ID number of target quote """ quote = self.client['Billing_Order_Quote'] container = quote.getRecalculatedOrderContainer(id=quote_id) return container
python
def get_order_container(self, quote_id): """Generate an order container from a quote object. :param quote_id: ID number of target quote """ quote = self.client['Billing_Order_Quote'] container = quote.getRecalculatedOrderContainer(id=quote_id) return container
[ "def", "get_order_container", "(", "self", ",", "quote_id", ")", ":", "quote", "=", "self", ".", "client", "[", "'Billing_Order_Quote'", "]", "container", "=", "quote", ".", "getRecalculatedOrderContainer", "(", "id", "=", "quote_id", ")", "return", "container" ...
Generate an order container from a quote object. :param quote_id: ID number of target quote
[ "Generate", "an", "order", "container", "from", "a", "quote", "object", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L154-L162
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.generate_order_template
def generate_order_template(self, quote_id, extra, quantity=1): """Generate a complete order template. :param int quote_id: ID of target quote :param dictionary extra: Overrides for the defaults of SoftLayer_Container_Product_Order :param int quantity: Number of items to order. ...
python
def generate_order_template(self, quote_id, extra, quantity=1): """Generate a complete order template. :param int quote_id: ID of target quote :param dictionary extra: Overrides for the defaults of SoftLayer_Container_Product_Order :param int quantity: Number of items to order. ...
[ "def", "generate_order_template", "(", "self", ",", "quote_id", ",", "extra", ",", "quantity", "=", "1", ")", ":", "if", "not", "isinstance", "(", "extra", ",", "dict", ")", ":", "raise", "ValueError", "(", "\"extra is not formatted properly\"", ")", "containe...
Generate a complete order template. :param int quote_id: ID of target quote :param dictionary extra: Overrides for the defaults of SoftLayer_Container_Product_Order :param int quantity: Number of items to order.
[ "Generate", "a", "complete", "order", "template", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L164-L181
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.verify_quote
def verify_quote(self, quote_id, extra): """Verifies that a quote order is valid. :: extras = { 'hardware': {'hostname': 'test', 'domain': 'testing.com'}, 'quantity': 2 } manager = ordering.OrderingManager(env.client) resu...
python
def verify_quote(self, quote_id, extra): """Verifies that a quote order is valid. :: extras = { 'hardware': {'hostname': 'test', 'domain': 'testing.com'}, 'quantity': 2 } manager = ordering.OrderingManager(env.client) resu...
[ "def", "verify_quote", "(", "self", ",", "quote_id", ",", "extra", ")", ":", "container", "=", "self", ".", "generate_order_template", "(", "quote_id", ",", "extra", ")", "clean_container", "=", "{", "}", "for", "key", "in", "container", ".", "keys", "(", ...
Verifies that a quote order is valid. :: extras = { 'hardware': {'hostname': 'test', 'domain': 'testing.com'}, 'quantity': 2 } manager = ordering.OrderingManager(env.client) result = manager.verify_quote(12345, extras) :...
[ "Verifies", "that", "a", "quote", "order", "is", "valid", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L183-L210
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.order_quote
def order_quote(self, quote_id, extra): """Places an order using a quote :: extras = { 'hardware': {'hostname': 'test', 'domain': 'testing.com'}, 'quantity': 2 } manager = ordering.OrderingManager(env.client) result = mana...
python
def order_quote(self, quote_id, extra): """Places an order using a quote :: extras = { 'hardware': {'hostname': 'test', 'domain': 'testing.com'}, 'quantity': 2 } manager = ordering.OrderingManager(env.client) result = mana...
[ "def", "order_quote", "(", "self", ",", "quote_id", ",", "extra", ")", ":", "container", "=", "self", ".", "generate_order_template", "(", "quote_id", ",", "extra", ")", "return", "self", ".", "client", ".", "call", "(", "'SoftLayer_Billing_Order_Quote'", ",",...
Places an order using a quote :: extras = { 'hardware': {'hostname': 'test', 'domain': 'testing.com'}, 'quantity': 2 } manager = ordering.OrderingManager(env.client) result = manager.order_quote(12345, extras) :param int ...
[ "Places", "an", "order", "using", "a", "quote" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L212-L230
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_package_by_key
def get_package_by_key(self, package_keyname, mask=None): """Get a single package with a given key. If no packages are found, returns None :param package_keyname: string representing the package key name we are interested in. :param string mask: Mask to specify the properties we want t...
python
def get_package_by_key(self, package_keyname, mask=None): """Get a single package with a given key. If no packages are found, returns None :param package_keyname: string representing the package key name we are interested in. :param string mask: Mask to specify the properties we want t...
[ "def", "get_package_by_key", "(", "self", ",", "package_keyname", ",", "mask", "=", "None", ")", ":", "_filter", "=", "{", "'keyName'", ":", "{", "'operation'", ":", "package_keyname", "}", "}", "packages", "=", "self", ".", "package_svc", ".", "getAllObject...
Get a single package with a given key. If no packages are found, returns None :param package_keyname: string representing the package key name we are interested in. :param string mask: Mask to specify the properties we want to retrieve
[ "Get", "a", "single", "package", "with", "a", "given", "key", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L232-L246
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.list_categories
def list_categories(self, package_keyname, **kwargs): """List the categories for the given package. :param str package_keyname: The package for which to get the categories. :returns: List of categories associated with the package """ get_kwargs = {} get_kwargs['mask'] = ...
python
def list_categories(self, package_keyname, **kwargs): """List the categories for the given package. :param str package_keyname: The package for which to get the categories. :returns: List of categories associated with the package """ get_kwargs = {} get_kwargs['mask'] = ...
[ "def", "list_categories", "(", "self", ",", "package_keyname", ",", "**", "kwargs", ")", ":", "get_kwargs", "=", "{", "}", "get_kwargs", "[", "'mask'", "]", "=", "kwargs", ".", "get", "(", "'mask'", ",", "CATEGORY_MASK", ")", "if", "'filter'", "in", "kwa...
List the categories for the given package. :param str package_keyname: The package for which to get the categories. :returns: List of categories associated with the package
[ "List", "the", "categories", "for", "the", "given", "package", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L248-L262
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.list_items
def list_items(self, package_keyname, **kwargs): """List the items for the given package. :param str package_keyname: The package for which to get the items. :returns: List of items in the package """ get_kwargs = {} get_kwargs['mask'] = kwargs.get('mask', ITEM_MASK) ...
python
def list_items(self, package_keyname, **kwargs): """List the items for the given package. :param str package_keyname: The package for which to get the items. :returns: List of items in the package """ get_kwargs = {} get_kwargs['mask'] = kwargs.get('mask', ITEM_MASK) ...
[ "def", "list_items", "(", "self", ",", "package_keyname", ",", "**", "kwargs", ")", ":", "get_kwargs", "=", "{", "}", "get_kwargs", "[", "'mask'", "]", "=", "kwargs", ".", "get", "(", "'mask'", ",", "ITEM_MASK", ")", "if", "'filter'", "in", "kwargs", "...
List the items for the given package. :param str package_keyname: The package for which to get the items. :returns: List of items in the package
[ "List", "the", "items", "for", "the", "given", "package", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L264-L279
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.list_packages
def list_packages(self, **kwargs): """List active packages. :returns: List of active packages. """ get_kwargs = {} get_kwargs['mask'] = kwargs.get('mask', PACKAGE_MASK) if 'filter' in kwargs: get_kwargs['filter'] = kwargs['filter'] packages = self....
python
def list_packages(self, **kwargs): """List active packages. :returns: List of active packages. """ get_kwargs = {} get_kwargs['mask'] = kwargs.get('mask', PACKAGE_MASK) if 'filter' in kwargs: get_kwargs['filter'] = kwargs['filter'] packages = self....
[ "def", "list_packages", "(", "self", ",", "**", "kwargs", ")", ":", "get_kwargs", "=", "{", "}", "get_kwargs", "[", "'mask'", "]", "=", "kwargs", ".", "get", "(", "'mask'", ",", "PACKAGE_MASK", ")", "if", "'filter'", "in", "kwargs", ":", "get_kwargs", ...
List active packages. :returns: List of active packages.
[ "List", "active", "packages", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L281-L295
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.list_presets
def list_presets(self, package_keyname, **kwargs): """Gets active presets for the given package. :param str package_keyname: The package for which to get presets :returns: A list of package presets that can be used for ordering """ get_kwargs = {} get_kwargs['mask'] = k...
python
def list_presets(self, package_keyname, **kwargs): """Gets active presets for the given package. :param str package_keyname: The package for which to get presets :returns: A list of package presets that can be used for ordering """ get_kwargs = {} get_kwargs['mask'] = k...
[ "def", "list_presets", "(", "self", ",", "package_keyname", ",", "**", "kwargs", ")", ":", "get_kwargs", "=", "{", "}", "get_kwargs", "[", "'mask'", "]", "=", "kwargs", ".", "get", "(", "'mask'", ",", "PRESET_MASK", ")", "if", "'filter'", "in", "kwargs",...
Gets active presets for the given package. :param str package_keyname: The package for which to get presets :returns: A list of package presets that can be used for ordering
[ "Gets", "active", "presets", "for", "the", "given", "package", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L297-L313
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_preset_by_key
def get_preset_by_key(self, package_keyname, preset_keyname, mask=None): """Gets a single preset with the given key.""" preset_operation = '_= %s' % preset_keyname _filter = { 'activePresets': { 'keyName': { 'operation': preset_operation ...
python
def get_preset_by_key(self, package_keyname, preset_keyname, mask=None): """Gets a single preset with the given key.""" preset_operation = '_= %s' % preset_keyname _filter = { 'activePresets': { 'keyName': { 'operation': preset_operation ...
[ "def", "get_preset_by_key", "(", "self", ",", "package_keyname", ",", "preset_keyname", ",", "mask", "=", "None", ")", ":", "preset_operation", "=", "'_= %s'", "%", "preset_keyname", "_filter", "=", "{", "'activePresets'", ":", "{", "'keyName'", ":", "{", "'op...
Gets a single preset with the given key.
[ "Gets", "a", "single", "preset", "with", "the", "given", "key", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L315-L338
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_price_id_list
def get_price_id_list(self, package_keyname, item_keynames, core=None): """Converts a list of item keynames to a list of price IDs. This function is used to convert a list of item keynames into a list of price IDs that are used in the Product_Order verifyOrder() and placeOrder() functio...
python
def get_price_id_list(self, package_keyname, item_keynames, core=None): """Converts a list of item keynames to a list of price IDs. This function is used to convert a list of item keynames into a list of price IDs that are used in the Product_Order verifyOrder() and placeOrder() functio...
[ "def", "get_price_id_list", "(", "self", ",", "package_keyname", ",", "item_keynames", ",", "core", "=", "None", ")", ":", "mask", "=", "'id, itemCategory, keyName, prices[categories]'", "items", "=", "self", ".", "list_items", "(", "package_keyname", ",", "mask", ...
Converts a list of item keynames to a list of price IDs. This function is used to convert a list of item keynames into a list of price IDs that are used in the Product_Order verifyOrder() and placeOrder() functions. :param str package_keyname: The package associated with the prices ...
[ "Converts", "a", "list", "of", "item", "keynames", "to", "a", "list", "of", "price", "IDs", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L340-L389
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_item_price_id
def get_item_price_id(core, prices): """get item price id""" price_id = None for price in prices: if not price['locationGroupId']: capacity_min = int(price.get('capacityRestrictionMinimum', -1)) capacity_max = int(price.get('capacityRestrictionMaximum'...
python
def get_item_price_id(core, prices): """get item price id""" price_id = None for price in prices: if not price['locationGroupId']: capacity_min = int(price.get('capacityRestrictionMinimum', -1)) capacity_max = int(price.get('capacityRestrictionMaximum'...
[ "def", "get_item_price_id", "(", "core", ",", "prices", ")", ":", "price_id", "=", "None", "for", "price", "in", "prices", ":", "if", "not", "price", "[", "'locationGroupId'", "]", ":", "capacity_min", "=", "int", "(", "price", ".", "get", "(", "'capacit...
get item price id
[ "get", "item", "price", "id" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L392-L405
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_preset_prices
def get_preset_prices(self, preset): """Get preset item prices. Retrieve a SoftLayer_Product_Package_Preset record. :param int preset: preset identifier. :returns: A list of price IDs associated with the given preset_id. """ mask = 'mask[prices[item]]' prices ...
python
def get_preset_prices(self, preset): """Get preset item prices. Retrieve a SoftLayer_Product_Package_Preset record. :param int preset: preset identifier. :returns: A list of price IDs associated with the given preset_id. """ mask = 'mask[prices[item]]' prices ...
[ "def", "get_preset_prices", "(", "self", ",", "preset", ")", ":", "mask", "=", "'mask[prices[item]]'", "prices", "=", "self", ".", "package_preset", ".", "getObject", "(", "id", "=", "preset", ",", "mask", "=", "mask", ")", "return", "prices" ]
Get preset item prices. Retrieve a SoftLayer_Product_Package_Preset record. :param int preset: preset identifier. :returns: A list of price IDs associated with the given preset_id.
[ "Get", "preset", "item", "prices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L407-L419
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_item_prices
def get_item_prices(self, package_id): """Get item prices. Retrieve a SoftLayer_Product_Package item prices record. :param int package_id: package identifier. :returns: A list of price IDs associated with the given package. """ mask = 'mask[pricingLocationGroup[locatio...
python
def get_item_prices(self, package_id): """Get item prices. Retrieve a SoftLayer_Product_Package item prices record. :param int package_id: package identifier. :returns: A list of price IDs associated with the given package. """ mask = 'mask[pricingLocationGroup[locatio...
[ "def", "get_item_prices", "(", "self", ",", "package_id", ")", ":", "mask", "=", "'mask[pricingLocationGroup[locations]]'", "prices", "=", "self", ".", "package_svc", ".", "getItemPrices", "(", "id", "=", "package_id", ",", "mask", "=", "mask", ")", "return", ...
Get item prices. Retrieve a SoftLayer_Product_Package item prices record. :param int package_id: package identifier. :returns: A list of price IDs associated with the given package.
[ "Get", "item", "prices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L421-L433
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.verify_order
def verify_order(self, package_keyname, location, item_keynames, complex_type=None, hourly=True, preset_keyname=None, extras=None, quantity=1): """Verifies an order with the given package and prices. This function takes in parameters needed for an order and verifies the order ...
python
def verify_order(self, package_keyname, location, item_keynames, complex_type=None, hourly=True, preset_keyname=None, extras=None, quantity=1): """Verifies an order with the given package and prices. This function takes in parameters needed for an order and verifies the order ...
[ "def", "verify_order", "(", "self", ",", "package_keyname", ",", "location", ",", "item_keynames", ",", "complex_type", "=", "None", ",", "hourly", "=", "True", ",", "preset_keyname", "=", "None", ",", "extras", "=", "None", ",", "quantity", "=", "1", ")",...
Verifies an order with the given package and prices. This function takes in parameters needed for an order and verifies the order to ensure the given items are compatible with the given package. :param str package_keyname: The keyname for the package being ordered :param str location: ...
[ "Verifies", "an", "order", "with", "the", "given", "package", "and", "prices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L435-L464
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.place_order
def place_order(self, package_keyname, location, item_keynames, complex_type=None, hourly=True, preset_keyname=None, extras=None, quantity=1): """Places an order with the given package and prices. This function takes in parameters needed for an order and places the order. :...
python
def place_order(self, package_keyname, location, item_keynames, complex_type=None, hourly=True, preset_keyname=None, extras=None, quantity=1): """Places an order with the given package and prices. This function takes in parameters needed for an order and places the order. :...
[ "def", "place_order", "(", "self", ",", "package_keyname", ",", "location", ",", "item_keynames", ",", "complex_type", "=", "None", ",", "hourly", "=", "True", ",", "preset_keyname", "=", "None", ",", "extras", "=", "None", ",", "quantity", "=", "1", ")", ...
Places an order with the given package and prices. This function takes in parameters needed for an order and places the order. :param str package_keyname: The keyname for the package being ordered :param str location: The datacenter location string for ordering (Ex: DALLAS13) :param li...
[ "Places", "an", "order", "with", "the", "given", "package", "and", "prices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L466-L494
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.place_quote
def place_quote(self, package_keyname, location, item_keynames, complex_type=None, preset_keyname=None, extras=None, quantity=1, quote_name=None, send_email=False): """Place a quote with the given package and prices. This function takes in parameters needed for an order and places t...
python
def place_quote(self, package_keyname, location, item_keynames, complex_type=None, preset_keyname=None, extras=None, quantity=1, quote_name=None, send_email=False): """Place a quote with the given package and prices. This function takes in parameters needed for an order and places t...
[ "def", "place_quote", "(", "self", ",", "package_keyname", ",", "location", ",", "item_keynames", ",", "complex_type", "=", "None", ",", "preset_keyname", "=", "None", ",", "extras", "=", "None", ",", "quantity", "=", "1", ",", "quote_name", "=", "None", "...
Place a quote with the given package and prices. This function takes in parameters needed for an order and places the quote. :param str package_keyname: The keyname for the package being ordered :param str location: The datacenter location string for ordering (Ex: DALLAS13) :param list...
[ "Place", "a", "quote", "with", "the", "given", "package", "and", "prices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L496-L527
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.generate_order
def generate_order(self, package_keyname, location, item_keynames, complex_type=None, hourly=True, preset_keyname=None, extras=None, quantity=1): """Generates an order with the given package and prices. This function takes in parameters needed for an order and generates an order ...
python
def generate_order(self, package_keyname, location, item_keynames, complex_type=None, hourly=True, preset_keyname=None, extras=None, quantity=1): """Generates an order with the given package and prices. This function takes in parameters needed for an order and generates an order ...
[ "def", "generate_order", "(", "self", ",", "package_keyname", ",", "location", ",", "item_keynames", ",", "complex_type", "=", "None", ",", "hourly", "=", "True", ",", "preset_keyname", "=", "None", ",", "extras", "=", "None", ",", "quantity", "=", "1", ")...
Generates an order with the given package and prices. This function takes in parameters needed for an order and generates an order dictionary. This dictionary can then be used in either verify or placeOrder(). :param str package_keyname: The keyname for the package being ordered :param...
[ "Generates", "an", "order", "with", "the", "given", "package", "and", "prices", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L529-L588
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.package_locations
def package_locations(self, package_keyname): """List datacenter locations for a package keyname :param str package_keyname: The package for which to get the items. :returns: List of locations a package is orderable in """ mask = "mask[description, keyname, locations]" ...
python
def package_locations(self, package_keyname): """List datacenter locations for a package keyname :param str package_keyname: The package for which to get the items. :returns: List of locations a package is orderable in """ mask = "mask[description, keyname, locations]" ...
[ "def", "package_locations", "(", "self", ",", "package_keyname", ")", ":", "mask", "=", "\"mask[description, keyname, locations]\"", "package", "=", "self", ".", "get_package_by_key", "(", "package_keyname", ",", "mask", "=", "'id'", ")", "regions", "=", "self", "...
List datacenter locations for a package keyname :param str package_keyname: The package for which to get the items. :returns: List of locations a package is orderable in
[ "List", "datacenter", "locations", "for", "a", "package", "keyname" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L590-L601
train
softlayer/softlayer-python
SoftLayer/managers/ordering.py
OrderingManager.get_location_id
def get_location_id(self, location): """Finds the location ID of a given datacenter This is mostly used so either a dc name, or regions keyname can be used when ordering :param str location: Region Keyname (DALLAS13) or datacenter name (dal13) :returns: integer id of the datacenter ...
python
def get_location_id(self, location): """Finds the location ID of a given datacenter This is mostly used so either a dc name, or regions keyname can be used when ordering :param str location: Region Keyname (DALLAS13) or datacenter name (dal13) :returns: integer id of the datacenter ...
[ "def", "get_location_id", "(", "self", ",", "location", ")", ":", "if", "isinstance", "(", "location", ",", "int", ")", ":", "return", "location", "mask", "=", "\"mask[id,name,regions[keyname]]\"", "if", "match", "(", "r'[a-zA-Z]{3}[0-9]{2}'", ",", "location", "...
Finds the location ID of a given datacenter This is mostly used so either a dc name, or regions keyname can be used when ordering :param str location: Region Keyname (DALLAS13) or datacenter name (dal13) :returns: integer id of the datacenter
[ "Finds", "the", "location", "ID", "of", "a", "given", "datacenter" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ordering.py#L603-L621
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.add_global_ip
def add_global_ip(self, version=4, test_order=False): """Adds a global IP address to the account. :param int version: Specifies whether this is IPv4 or IPv6 :param bool test_order: If true, this will only verify the order. """ # This method is here to improve the public interfac...
python
def add_global_ip(self, version=4, test_order=False): """Adds a global IP address to the account. :param int version: Specifies whether this is IPv4 or IPv6 :param bool test_order: If true, this will only verify the order. """ # This method is here to improve the public interfac...
[ "def", "add_global_ip", "(", "self", ",", "version", "=", "4", ",", "test_order", "=", "False", ")", ":", "return", "self", ".", "add_subnet", "(", "'global'", ",", "version", "=", "version", ",", "test_order", "=", "test_order", ")" ]
Adds a global IP address to the account. :param int version: Specifies whether this is IPv4 or IPv6 :param bool test_order: If true, this will only verify the order.
[ "Adds", "a", "global", "IP", "address", "to", "the", "account", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L58-L68
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.add_securitygroup_rule
def add_securitygroup_rule(self, group_id, remote_ip=None, remote_group=None, direction=None, ethertype=None, port_max=None, port_min=None, protocol=None): """Add a rule to a security group :param int group_id:...
python
def add_securitygroup_rule(self, group_id, remote_ip=None, remote_group=None, direction=None, ethertype=None, port_max=None, port_min=None, protocol=None): """Add a rule to a security group :param int group_id:...
[ "def", "add_securitygroup_rule", "(", "self", ",", "group_id", ",", "remote_ip", "=", "None", ",", "remote_group", "=", "None", ",", "direction", "=", "None", ",", "ethertype", "=", "None", ",", "port_max", "=", "None", ",", "port_min", "=", "None", ",", ...
Add a rule to a security group :param int group_id: The ID of the security group to add this rule to :param str remote_ip: The remote IP or CIDR to enforce the rule on :param int remote_group: The remote security group ID to enforce the rule on :param st...
[ "Add", "a", "rule", "to", "a", "security", "group" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L70-L101
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.add_securitygroup_rules
def add_securitygroup_rules(self, group_id, rules): """Add rules to a security group :param int group_id: The ID of the security group to add the rules to :param list rules: The list of rule dictionaries to add """ if not isinstance(rules, list): raise TypeError("The...
python
def add_securitygroup_rules(self, group_id, rules): """Add rules to a security group :param int group_id: The ID of the security group to add the rules to :param list rules: The list of rule dictionaries to add """ if not isinstance(rules, list): raise TypeError("The...
[ "def", "add_securitygroup_rules", "(", "self", ",", "group_id", ",", "rules", ")", ":", "if", "not", "isinstance", "(", "rules", ",", "list", ")", ":", "raise", "TypeError", "(", "\"The rules provided must be a list of dictionaries\"", ")", "return", "self", ".", ...
Add rules to a security group :param int group_id: The ID of the security group to add the rules to :param list rules: The list of rule dictionaries to add
[ "Add", "rules", "to", "a", "security", "group" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L103-L111
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.add_subnet
def add_subnet(self, subnet_type, quantity=None, vlan_id=None, version=4, test_order=False): """Orders a new subnet :param str subnet_type: Type of subnet to add: private, public, global :param int quantity: Number of IPs in the subnet :param int vlan_id: VLAN id for ...
python
def add_subnet(self, subnet_type, quantity=None, vlan_id=None, version=4, test_order=False): """Orders a new subnet :param str subnet_type: Type of subnet to add: private, public, global :param int quantity: Number of IPs in the subnet :param int vlan_id: VLAN id for ...
[ "def", "add_subnet", "(", "self", ",", "subnet_type", ",", "quantity", "=", "None", ",", "vlan_id", "=", "None", ",", "version", "=", "4", ",", "test_order", "=", "False", ")", ":", "package", "=", "self", ".", "client", "[", "'Product_Package'", "]", ...
Orders a new subnet :param str subnet_type: Type of subnet to add: private, public, global :param int quantity: Number of IPs in the subnet :param int vlan_id: VLAN id for the subnet to be placed into :param int version: 4 for IPv4, 6 for IPv6 :param bool test_order: If true, th...
[ "Orders", "a", "new", "subnet" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L113-L171
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.assign_global_ip
def assign_global_ip(self, global_ip_id, target): """Assigns a global IP address to a specified target. :param int global_ip_id: The ID of the global IP being assigned :param string target: The IP address to assign """ return self.client['Network_Subnet_IpAddress_Global'].route(...
python
def assign_global_ip(self, global_ip_id, target): """Assigns a global IP address to a specified target. :param int global_ip_id: The ID of the global IP being assigned :param string target: The IP address to assign """ return self.client['Network_Subnet_IpAddress_Global'].route(...
[ "def", "assign_global_ip", "(", "self", ",", "global_ip_id", ",", "target", ")", ":", "return", "self", ".", "client", "[", "'Network_Subnet_IpAddress_Global'", "]", ".", "route", "(", "target", ",", "id", "=", "global_ip_id", ")" ]
Assigns a global IP address to a specified target. :param int global_ip_id: The ID of the global IP being assigned :param string target: The IP address to assign
[ "Assigns", "a", "global", "IP", "address", "to", "a", "specified", "target", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L173-L180
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.attach_securitygroup_components
def attach_securitygroup_components(self, group_id, component_ids): """Attaches network components to a security group. :param int group_id: The ID of the security group :param list component_ids: The IDs of the network components to attach """ return self.security_group.attachN...
python
def attach_securitygroup_components(self, group_id, component_ids): """Attaches network components to a security group. :param int group_id: The ID of the security group :param list component_ids: The IDs of the network components to attach """ return self.security_group.attachN...
[ "def", "attach_securitygroup_components", "(", "self", ",", "group_id", ",", "component_ids", ")", ":", "return", "self", ".", "security_group", ".", "attachNetworkComponents", "(", "component_ids", ",", "id", "=", "group_id", ")" ]
Attaches network components to a security group. :param int group_id: The ID of the security group :param list component_ids: The IDs of the network components to attach
[ "Attaches", "network", "components", "to", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L191-L198
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.cancel_global_ip
def cancel_global_ip(self, global_ip_id): """Cancels the specified global IP address. :param int id: The ID of the global IP to be cancelled. """ service = self.client['Network_Subnet_IpAddress_Global'] ip_address = service.getObject(id=global_ip_id, mask='billingItem') ...
python
def cancel_global_ip(self, global_ip_id): """Cancels the specified global IP address. :param int id: The ID of the global IP to be cancelled. """ service = self.client['Network_Subnet_IpAddress_Global'] ip_address = service.getObject(id=global_ip_id, mask='billingItem') ...
[ "def", "cancel_global_ip", "(", "self", ",", "global_ip_id", ")", ":", "service", "=", "self", ".", "client", "[", "'Network_Subnet_IpAddress_Global'", "]", "ip_address", "=", "service", ".", "getObject", "(", "id", "=", "global_ip_id", ",", "mask", "=", "'bil...
Cancels the specified global IP address. :param int id: The ID of the global IP to be cancelled.
[ "Cancels", "the", "specified", "global", "IP", "address", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L200-L209
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.cancel_subnet
def cancel_subnet(self, subnet_id): """Cancels the specified subnet. :param int subnet_id: The ID of the subnet to be cancelled. """ subnet = self.get_subnet(subnet_id, mask='id, billingItem.id') if "billingItem" not in subnet: raise exceptions.SoftLayerError("subnet...
python
def cancel_subnet(self, subnet_id): """Cancels the specified subnet. :param int subnet_id: The ID of the subnet to be cancelled. """ subnet = self.get_subnet(subnet_id, mask='id, billingItem.id') if "billingItem" not in subnet: raise exceptions.SoftLayerError("subnet...
[ "def", "cancel_subnet", "(", "self", ",", "subnet_id", ")", ":", "subnet", "=", "self", ".", "get_subnet", "(", "subnet_id", ",", "mask", "=", "'id, billingItem.id'", ")", "if", "\"billingItem\"", "not", "in", "subnet", ":", "raise", "exceptions", ".", "Soft...
Cancels the specified subnet. :param int subnet_id: The ID of the subnet to be cancelled.
[ "Cancels", "the", "specified", "subnet", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L211-L221
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.create_securitygroup
def create_securitygroup(self, name=None, description=None): """Creates a security group. :param string name: The name of the security group :param string description: The description of the security group """ create_dict = {'name': name, 'description': description} ret...
python
def create_securitygroup(self, name=None, description=None): """Creates a security group. :param string name: The name of the security group :param string description: The description of the security group """ create_dict = {'name': name, 'description': description} ret...
[ "def", "create_securitygroup", "(", "self", ",", "name", "=", "None", ",", "description", "=", "None", ")", ":", "create_dict", "=", "{", "'name'", ":", "name", ",", "'description'", ":", "description", "}", "return", "self", ".", "security_group", ".", "c...
Creates a security group. :param string name: The name of the security group :param string description: The description of the security group
[ "Creates", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L223-L231
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.detach_securitygroup_components
def detach_securitygroup_components(self, group_id, component_ids): """Detaches network components from a security group. :param int group_id: The ID of the security group :param list component_ids: The IDs of the network components to detach """ return self.security_group.detac...
python
def detach_securitygroup_components(self, group_id, component_ids): """Detaches network components from a security group. :param int group_id: The ID of the security group :param list component_ids: The IDs of the network components to detach """ return self.security_group.detac...
[ "def", "detach_securitygroup_components", "(", "self", ",", "group_id", ",", "component_ids", ")", ":", "return", "self", ".", "security_group", ".", "detachNetworkComponents", "(", "component_ids", ",", "id", "=", "group_id", ")" ]
Detaches network components from a security group. :param int group_id: The ID of the security group :param list component_ids: The IDs of the network components to detach
[ "Detaches", "network", "components", "from", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L248-L255
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.edit_rwhois
def edit_rwhois(self, abuse_email=None, address1=None, address2=None, city=None, company_name=None, country=None, first_name=None, last_name=None, postal_code=None, private_residence=None, state=None): """Edit rwhois record.""" update = {} ...
python
def edit_rwhois(self, abuse_email=None, address1=None, address2=None, city=None, company_name=None, country=None, first_name=None, last_name=None, postal_code=None, private_residence=None, state=None): """Edit rwhois record.""" update = {} ...
[ "def", "edit_rwhois", "(", "self", ",", "abuse_email", "=", "None", ",", "address1", "=", "None", ",", "address2", "=", "None", ",", "city", "=", "None", ",", "company_name", "=", "None", ",", "country", "=", "None", ",", "first_name", "=", "None", ","...
Edit rwhois record.
[ "Edit", "rwhois", "record", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L257-L283
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.edit_securitygroup
def edit_securitygroup(self, group_id, name=None, description=None): """Edit security group details. :param int group_id: The ID of the security group :param string name: The name of the security group :param string description: The description of the security group """ ...
python
def edit_securitygroup(self, group_id, name=None, description=None): """Edit security group details. :param int group_id: The ID of the security group :param string name: The name of the security group :param string description: The description of the security group """ ...
[ "def", "edit_securitygroup", "(", "self", ",", "group_id", ",", "name", "=", "None", ",", "description", "=", "None", ")", ":", "successful", "=", "False", "obj", "=", "{", "}", "if", "name", ":", "obj", "[", "'name'", "]", "=", "name", "if", "descri...
Edit security group details. :param int group_id: The ID of the security group :param string name: The name of the security group :param string description: The description of the security group
[ "Edit", "security", "group", "details", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L285-L302
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.edit_securitygroup_rule
def edit_securitygroup_rule(self, group_id, rule_id, remote_ip=None, remote_group=None, direction=None, ethertype=None, port_max=None, port_min=None, protocol=None): """Edit a security group rule. :param int...
python
def edit_securitygroup_rule(self, group_id, rule_id, remote_ip=None, remote_group=None, direction=None, ethertype=None, port_max=None, port_min=None, protocol=None): """Edit a security group rule. :param int...
[ "def", "edit_securitygroup_rule", "(", "self", ",", "group_id", ",", "rule_id", ",", "remote_ip", "=", "None", ",", "remote_group", "=", "None", ",", "direction", "=", "None", ",", "ethertype", "=", "None", ",", "port_max", "=", "None", ",", "port_min", "=...
Edit a security group rule. :param int group_id: The ID of the security group the rule belongs to :param int rule_id: The ID of the rule to edit :param str remote_ip: The remote IP or CIDR to enforce the rule on :param int remote_group: The remote security group ID to enforce ...
[ "Edit", "a", "security", "group", "rule", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L304-L342
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.ip_lookup
def ip_lookup(self, ip_address): """Looks up an IP address and returns network information about it. :param string ip_address: An IP address. Can be IPv4 or IPv6 :returns: A dictionary of information about the IP """ obj = self.client['Network_Subnet_IpAddress'] return ...
python
def ip_lookup(self, ip_address): """Looks up an IP address and returns network information about it. :param string ip_address: An IP address. Can be IPv4 or IPv6 :returns: A dictionary of information about the IP """ obj = self.client['Network_Subnet_IpAddress'] return ...
[ "def", "ip_lookup", "(", "self", ",", "ip_address", ")", ":", "obj", "=", "self", ".", "client", "[", "'Network_Subnet_IpAddress'", "]", "return", "obj", ".", "getByIpAddress", "(", "ip_address", ",", "mask", "=", "'hardware, virtualGuest'", ")" ]
Looks up an IP address and returns network information about it. :param string ip_address: An IP address. Can be IPv4 or IPv6 :returns: A dictionary of information about the IP
[ "Looks", "up", "an", "IP", "address", "and", "returns", "network", "information", "about", "it", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L344-L352
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.get_securitygroup
def get_securitygroup(self, group_id, **kwargs): """Returns the information about the given security group. :param string id: The ID for the security group :returns: A diction of information about the security group """ if 'mask' not in kwargs: kwargs['mask'] = ( ...
python
def get_securitygroup(self, group_id, **kwargs): """Returns the information about the given security group. :param string id: The ID for the security group :returns: A diction of information about the security group """ if 'mask' not in kwargs: kwargs['mask'] = ( ...
[ "def", "get_securitygroup", "(", "self", ",", "group_id", ",", "**", "kwargs", ")", ":", "if", "'mask'", "not", "in", "kwargs", ":", "kwargs", "[", "'mask'", "]", "=", "(", "'id,'", "'name,'", "'description,'", ")", "return", "self", ".", "security_group",...
Returns the information about the given security group. :param string id: The ID for the security group :returns: A diction of information about the security group
[ "Returns", "the", "information", "about", "the", "given", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L361-L389
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.get_subnet
def get_subnet(self, subnet_id, **kwargs): """Returns information about a single subnet. :param string id: Either the ID for the subnet or its network identifier :returns: A dictionary of information about the subnet """ if 'mask' not in kwargs: ...
python
def get_subnet(self, subnet_id, **kwargs): """Returns information about a single subnet. :param string id: Either the ID for the subnet or its network identifier :returns: A dictionary of information about the subnet """ if 'mask' not in kwargs: ...
[ "def", "get_subnet", "(", "self", ",", "subnet_id", ",", "**", "kwargs", ")", ":", "if", "'mask'", "not", "in", "kwargs", ":", "kwargs", "[", "'mask'", "]", "=", "DEFAULT_SUBNET_MASK", "return", "self", ".", "subnet", ".", "getObject", "(", "id", "=", ...
Returns information about a single subnet. :param string id: Either the ID for the subnet or its network identifier :returns: A dictionary of information about the subnet
[ "Returns", "information", "about", "a", "single", "subnet", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L391-L401
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.get_vlan
def get_vlan(self, vlan_id): """Returns information about a single VLAN. :param int id: The unique identifier for the VLAN :returns: A dictionary containing a large amount of information about the specified VLAN. """ return self.vlan.getObject(id=vlan_id, mask...
python
def get_vlan(self, vlan_id): """Returns information about a single VLAN. :param int id: The unique identifier for the VLAN :returns: A dictionary containing a large amount of information about the specified VLAN. """ return self.vlan.getObject(id=vlan_id, mask...
[ "def", "get_vlan", "(", "self", ",", "vlan_id", ")", ":", "return", "self", ".", "vlan", ".", "getObject", "(", "id", "=", "vlan_id", ",", "mask", "=", "DEFAULT_GET_VLAN_MASK", ")" ]
Returns information about a single VLAN. :param int id: The unique identifier for the VLAN :returns: A dictionary containing a large amount of information about the specified VLAN.
[ "Returns", "information", "about", "a", "single", "VLAN", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L403-L411
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.list_global_ips
def list_global_ips(self, version=None, identifier=None, **kwargs): """Returns a list of all global IP address records on the account. :param int version: Only returns IPs of this version (4 or 6) :param string identifier: If specified, the list will only contain the ...
python
def list_global_ips(self, version=None, identifier=None, **kwargs): """Returns a list of all global IP address records on the account. :param int version: Only returns IPs of this version (4 or 6) :param string identifier: If specified, the list will only contain the ...
[ "def", "list_global_ips", "(", "self", ",", "version", "=", "None", ",", "identifier", "=", "None", ",", "**", "kwargs", ")", ":", "if", "'mask'", "not", "in", "kwargs", ":", "mask", "=", "[", "'destinationIpAddress[hardware, virtualGuest]'", ",", "'ipAddress'...
Returns a list of all global IP address records on the account. :param int version: Only returns IPs of this version (4 or 6) :param string identifier: If specified, the list will only contain the global ips matching this network identifier.
[ "Returns", "a", "list", "of", "all", "global", "IP", "address", "records", "on", "the", "account", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L413-L436
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.list_subnets
def list_subnets(self, identifier=None, datacenter=None, version=0, subnet_type=None, network_space=None, **kwargs): """Display a list of all subnets on the account. This provides a quick overview of all subnets including information about data center residence and the numb...
python
def list_subnets(self, identifier=None, datacenter=None, version=0, subnet_type=None, network_space=None, **kwargs): """Display a list of all subnets on the account. This provides a quick overview of all subnets including information about data center residence and the numb...
[ "def", "list_subnets", "(", "self", ",", "identifier", "=", "None", ",", "datacenter", "=", "None", ",", "version", "=", "0", ",", "subnet_type", "=", "None", ",", "network_space", "=", "None", ",", "**", "kwargs", ")", ":", "if", "'mask'", "not", "in"...
Display a list of all subnets on the account. This provides a quick overview of all subnets including information about data center residence and the number of devices attached. :param string identifier: If specified, the list will only contain the subnet ma...
[ "Display", "a", "list", "of", "all", "subnets", "on", "the", "account", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L438-L480
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.list_vlans
def list_vlans(self, datacenter=None, vlan_number=None, name=None, **kwargs): """Display a list of all VLANs on the account. This provides a quick overview of all VLANs including information about data center residence and the number of devices attached. :param string datacenter: If sp...
python
def list_vlans(self, datacenter=None, vlan_number=None, name=None, **kwargs): """Display a list of all VLANs on the account. This provides a quick overview of all VLANs including information about data center residence and the number of devices attached. :param string datacenter: If sp...
[ "def", "list_vlans", "(", "self", ",", "datacenter", "=", "None", ",", "vlan_number", "=", "None", ",", "name", "=", "None", ",", "**", "kwargs", ")", ":", "_filter", "=", "utils", ".", "NestedDict", "(", "kwargs", ".", "get", "(", "'filter'", ")", "...
Display a list of all VLANs on the account. This provides a quick overview of all VLANs including information about data center residence and the number of devices attached. :param string datacenter: If specified, the list will only contain VLANs in the spec...
[ "Display", "a", "list", "of", "all", "VLANs", "on", "the", "account", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L482-L516
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.list_securitygroup_rules
def list_securitygroup_rules(self, group_id): """List security group rules associated with a security group. :param int group_id: The security group to list rules for """ return self.security_group.getRules(id=group_id, iter=True)
python
def list_securitygroup_rules(self, group_id): """List security group rules associated with a security group. :param int group_id: The security group to list rules for """ return self.security_group.getRules(id=group_id, iter=True)
[ "def", "list_securitygroup_rules", "(", "self", ",", "group_id", ")", ":", "return", "self", ".", "security_group", ".", "getRules", "(", "id", "=", "group_id", ",", "iter", "=", "True", ")" ]
List security group rules associated with a security group. :param int group_id: The security group to list rules for
[ "List", "security", "group", "rules", "associated", "with", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L523-L528
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.remove_securitygroup_rules
def remove_securitygroup_rules(self, group_id, rules): """Remove rules from a security group. :param int group_id: The ID of the security group :param list rules: The list of IDs to remove """ return self.security_group.removeRules(rules, id=group_id)
python
def remove_securitygroup_rules(self, group_id, rules): """Remove rules from a security group. :param int group_id: The ID of the security group :param list rules: The list of IDs to remove """ return self.security_group.removeRules(rules, id=group_id)
[ "def", "remove_securitygroup_rules", "(", "self", ",", "group_id", ",", "rules", ")", ":", "return", "self", ".", "security_group", ".", "removeRules", "(", "rules", ",", "id", "=", "group_id", ")" ]
Remove rules from a security group. :param int group_id: The ID of the security group :param list rules: The list of IDs to remove
[ "Remove", "rules", "from", "a", "security", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L538-L544
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.get_event_logs_by_request_id
def get_event_logs_by_request_id(self, request_id): """Gets all event logs by the given request id :param string request_id: The request id we want to filter on """ # Get all relevant event logs unfiltered_logs = self._get_cci_event_logs() + self._get_security_group_event_logs(...
python
def get_event_logs_by_request_id(self, request_id): """Gets all event logs by the given request id :param string request_id: The request id we want to filter on """ # Get all relevant event logs unfiltered_logs = self._get_cci_event_logs() + self._get_security_group_event_logs(...
[ "def", "get_event_logs_by_request_id", "(", "self", ",", "request_id", ")", ":", "unfiltered_logs", "=", "self", ".", "_get_cci_event_logs", "(", ")", "+", "self", ".", "_get_security_group_event_logs", "(", ")", "filtered_logs", "=", "[", "]", "for", "unfiltered_...
Gets all event logs by the given request id :param string request_id: The request id we want to filter on
[ "Gets", "all", "event", "logs", "by", "the", "given", "request", "id" ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L546-L567
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager.summary_by_datacenter
def summary_by_datacenter(self): """Summary of the networks on the account, grouped by data center. The resultant dictionary is primarily useful for statistical purposes. It contains count information rather than raw data. If you want raw information, see the :func:`list_vlans` method i...
python
def summary_by_datacenter(self): """Summary of the networks on the account, grouped by data center. The resultant dictionary is primarily useful for statistical purposes. It contains count information rather than raw data. If you want raw information, see the :func:`list_vlans` method i...
[ "def", "summary_by_datacenter", "(", "self", ")", ":", "datacenters", "=", "collections", ".", "defaultdict", "(", "lambda", ":", "{", "'hardware_count'", ":", "0", ",", "'public_ip_count'", ":", "0", ",", "'subnet_count'", ":", "0", ",", "'virtual_guest_count'"...
Summary of the networks on the account, grouped by data center. The resultant dictionary is primarily useful for statistical purposes. It contains count information rather than raw data. If you want raw information, see the :func:`list_vlans` method instead. :returns: A dictionary keye...
[ "Summary", "of", "the", "networks", "on", "the", "account", "grouped", "by", "data", "center", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L599-L634
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager._list_global_ips_by_identifier
def _list_global_ips_by_identifier(self, identifier): """Returns a list of IDs of the global IP matching the identifier. :param string identifier: The identifier to look up :returns: List of matching IDs """ results = self.list_global_ips(identifier=identifier, mask='id') ...
python
def _list_global_ips_by_identifier(self, identifier): """Returns a list of IDs of the global IP matching the identifier. :param string identifier: The identifier to look up :returns: List of matching IDs """ results = self.list_global_ips(identifier=identifier, mask='id') ...
[ "def", "_list_global_ips_by_identifier", "(", "self", ",", "identifier", ")", ":", "results", "=", "self", ".", "list_global_ips", "(", "identifier", "=", "identifier", ",", "mask", "=", "'id'", ")", "return", "[", "result", "[", "'id'", "]", "for", "result"...
Returns a list of IDs of the global IP matching the identifier. :param string identifier: The identifier to look up :returns: List of matching IDs
[ "Returns", "a", "list", "of", "IDs", "of", "the", "global", "IP", "matching", "the", "identifier", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L644-L651
train
softlayer/softlayer-python
SoftLayer/managers/network.py
NetworkManager._list_subnets_by_identifier
def _list_subnets_by_identifier(self, identifier): """Returns a list of IDs of the subnet matching the identifier. :param string identifier: The identifier to look up :returns: List of matching IDs """ identifier = identifier.split('/', 1)[0] results = self.list_subnets...
python
def _list_subnets_by_identifier(self, identifier): """Returns a list of IDs of the subnet matching the identifier. :param string identifier: The identifier to look up :returns: List of matching IDs """ identifier = identifier.split('/', 1)[0] results = self.list_subnets...
[ "def", "_list_subnets_by_identifier", "(", "self", ",", "identifier", ")", ":", "identifier", "=", "identifier", ".", "split", "(", "'/'", ",", "1", ")", "[", "0", "]", "results", "=", "self", ".", "list_subnets", "(", "identifier", "=", "identifier", ",",...
Returns a list of IDs of the subnet matching the identifier. :param string identifier: The identifier to look up :returns: List of matching IDs
[ "Returns", "a", "list", "of", "IDs", "of", "the", "subnet", "matching", "the", "identifier", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/network.py#L653-L662
train
softlayer/softlayer-python
SoftLayer/CLI/file/replication/partners.py
cli
def cli(env, columns, sortby, volume_id): """List existing replicant volumes for a file volume.""" file_storage_manager = SoftLayer.FileStorageManager(env.client) legal_volumes = file_storage_manager.get_replication_partners( volume_id ) if not legal_volumes: click.echo("There are ...
python
def cli(env, columns, sortby, volume_id): """List existing replicant volumes for a file volume.""" file_storage_manager = SoftLayer.FileStorageManager(env.client) legal_volumes = file_storage_manager.get_replication_partners( volume_id ) if not legal_volumes: click.echo("There are ...
[ "def", "cli", "(", "env", ",", "columns", ",", "sortby", ",", "volume_id", ")", ":", "file_storage_manager", "=", "SoftLayer", ".", "FileStorageManager", "(", "env", ".", "client", ")", "legal_volumes", "=", "file_storage_manager", ".", "get_replication_partners",...
List existing replicant volumes for a file volume.
[ "List", "existing", "replicant", "volumes", "for", "a", "file", "volume", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/file/replication/partners.py#L42-L60
train
softlayer/softlayer-python
SoftLayer/CLI/ticket/__init__.py
get_ticket_results
def get_ticket_results(mgr, ticket_id, update_count=1): """Get output about a ticket. :param integer id: the ticket ID :param integer update_count: number of entries to retrieve from ticket :returns: a KeyValue table containing the details of the ticket """ ticket = mgr.get_ticket(ticket_id) ...
python
def get_ticket_results(mgr, ticket_id, update_count=1): """Get output about a ticket. :param integer id: the ticket ID :param integer update_count: number of entries to retrieve from ticket :returns: a KeyValue table containing the details of the ticket """ ticket = mgr.get_ticket(ticket_id) ...
[ "def", "get_ticket_results", "(", "mgr", ",", "ticket_id", ",", "update_count", "=", "1", ")", ":", "ticket", "=", "mgr", ".", "get_ticket", "(", "ticket_id", ")", "table", "=", "formatting", ".", "KeyValueTable", "(", "[", "'name'", ",", "'value'", "]", ...
Get output about a ticket. :param integer id: the ticket ID :param integer update_count: number of entries to retrieve from ticket :returns: a KeyValue table containing the details of the ticket
[ "Get", "output", "about", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/__init__.py#L20-L68
train
softlayer/softlayer-python
SoftLayer/CLI/subnet/create.py
cli
def cli(env, network, quantity, vlan_id, ipv6, test): """Add a new subnet to your account. Valid quantities vary by type. \b Type - Valid Quantities (IPv4) public - 4, 8, 16, 32 private - 4, 8, 16, 32, 64 \b Type - Valid Quantities (IPv6) public - 64 """ mgr = SoftLayer.Ne...
python
def cli(env, network, quantity, vlan_id, ipv6, test): """Add a new subnet to your account. Valid quantities vary by type. \b Type - Valid Quantities (IPv4) public - 4, 8, 16, 32 private - 4, 8, 16, 32, 64 \b Type - Valid Quantities (IPv6) public - 64 """ mgr = SoftLayer.Ne...
[ "def", "cli", "(", "env", ",", "network", ",", "quantity", ",", "vlan_id", ",", "ipv6", ",", "test", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "if", "not", "(", "test", "or", "env", ".", "skip_confirmat...
Add a new subnet to your account. Valid quantities vary by type. \b Type - Valid Quantities (IPv4) public - 4, 8, 16, 32 private - 4, 8, 16, 32, 64 \b Type - Valid Quantities (IPv6) public - 64
[ "Add", "a", "new", "subnet", "to", "your", "account", ".", "Valid", "quantities", "vary", "by", "type", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/create.py#L21-L63
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.list_tickets
def list_tickets(self, open_status=True, closed_status=True): """List all tickets. :param boolean open_status: include open tickets :param boolean closed_status: include closed tickets """ mask = """mask[id, title, assignedUser[firstName, lastName], priority, c...
python
def list_tickets(self, open_status=True, closed_status=True): """List all tickets. :param boolean open_status: include open tickets :param boolean closed_status: include closed tickets """ mask = """mask[id, title, assignedUser[firstName, lastName], priority, c...
[ "def", "list_tickets", "(", "self", ",", "open_status", "=", "True", ",", "closed_status", "=", "True", ")", ":", "mask", "=", "call", "=", "'getTickets'", "if", "not", "all", "(", "[", "open_status", ",", "closed_status", "]", ")", ":", "if", "open_stat...
List all tickets. :param boolean open_status: include open tickets :param boolean closed_status: include closed tickets
[ "List", "all", "tickets", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L25-L43
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.create_ticket
def create_ticket(self, title=None, body=None, subject=None, priority=None): """Create a new ticket. :param string title: title for the new ticket :param string body: body for the new ticket :param integer subject: id of the subject to be assigned to the ticket :param integer pr...
python
def create_ticket(self, title=None, body=None, subject=None, priority=None): """Create a new ticket. :param string title: title for the new ticket :param string body: body for the new ticket :param integer subject: id of the subject to be assigned to the ticket :param integer pr...
[ "def", "create_ticket", "(", "self", ",", "title", "=", "None", ",", "body", "=", "None", ",", "subject", "=", "None", ",", "priority", "=", "None", ")", ":", "current_user", "=", "self", ".", "account", ".", "getCurrentUser", "(", ")", "new_ticket", "...
Create a new ticket. :param string title: title for the new ticket :param string body: body for the new ticket :param integer subject: id of the subject to be assigned to the ticket :param integer priority: Value from 1 (highest) to 4 (lowest)
[ "Create", "a", "new", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L60-L79
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.update_ticket
def update_ticket(self, ticket_id=None, body=None): """Update a ticket. :param integer ticket_id: the id of the ticket to update :param string body: entry to update in the ticket """ return self.ticket.addUpdate({'entry': body}, id=ticket_id)
python
def update_ticket(self, ticket_id=None, body=None): """Update a ticket. :param integer ticket_id: the id of the ticket to update :param string body: entry to update in the ticket """ return self.ticket.addUpdate({'entry': body}, id=ticket_id)
[ "def", "update_ticket", "(", "self", ",", "ticket_id", "=", "None", ",", "body", "=", "None", ")", ":", "return", "self", ".", "ticket", ".", "addUpdate", "(", "{", "'entry'", ":", "body", "}", ",", "id", "=", "ticket_id", ")" ]
Update a ticket. :param integer ticket_id: the id of the ticket to update :param string body: entry to update in the ticket
[ "Update", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L81-L87
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.upload_attachment
def upload_attachment(self, ticket_id=None, file_path=None, file_name=None): """Upload an attachment to a ticket. :param integer ticket_id: the id of the ticket to upload the attachment to :param string file_path: The path of the attachment to be uploaded :param string file_name: The na...
python
def upload_attachment(self, ticket_id=None, file_path=None, file_name=None): """Upload an attachment to a ticket. :param integer ticket_id: the id of the ticket to upload the attachment to :param string file_path: The path of the attachment to be uploaded :param string file_name: The na...
[ "def", "upload_attachment", "(", "self", ",", "ticket_id", "=", "None", ",", "file_path", "=", "None", ",", "file_name", "=", "None", ")", ":", "file_content", "=", "None", "with", "open", "(", "file_path", ",", "'rb'", ")", "as", "attached_file", ":", "...
Upload an attachment to a ticket. :param integer ticket_id: the id of the ticket to upload the attachment to :param string file_path: The path of the attachment to be uploaded :param string file_name: The name of the attachment shown in the ticket :returns: dict -- The uploaded attachme...
[ "Upload", "an", "attachment", "to", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L89-L106
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.attach_hardware
def attach_hardware(self, ticket_id=None, hardware_id=None): """Attach hardware to a ticket. :param integer ticket_id: the id of the ticket to attach to :param integer hardware_id: the id of the hardware to attach :returns: dict -- The new ticket attachment """ return s...
python
def attach_hardware(self, ticket_id=None, hardware_id=None): """Attach hardware to a ticket. :param integer ticket_id: the id of the ticket to attach to :param integer hardware_id: the id of the hardware to attach :returns: dict -- The new ticket attachment """ return s...
[ "def", "attach_hardware", "(", "self", ",", "ticket_id", "=", "None", ",", "hardware_id", "=", "None", ")", ":", "return", "self", ".", "ticket", ".", "addAttachedHardware", "(", "hardware_id", ",", "id", "=", "ticket_id", ")" ]
Attach hardware to a ticket. :param integer ticket_id: the id of the ticket to attach to :param integer hardware_id: the id of the hardware to attach :returns: dict -- The new ticket attachment
[ "Attach", "hardware", "to", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L108-L116
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.attach_virtual_server
def attach_virtual_server(self, ticket_id=None, virtual_id=None): """Attach a virtual server to a ticket. :param integer ticket_id: the id of the ticket to attach to :param integer virtual_id: the id of the virtual server to attach :returns: dict -- The new ticket attachment ""...
python
def attach_virtual_server(self, ticket_id=None, virtual_id=None): """Attach a virtual server to a ticket. :param integer ticket_id: the id of the ticket to attach to :param integer virtual_id: the id of the virtual server to attach :returns: dict -- The new ticket attachment ""...
[ "def", "attach_virtual_server", "(", "self", ",", "ticket_id", "=", "None", ",", "virtual_id", "=", "None", ")", ":", "return", "self", ".", "ticket", ".", "addAttachedVirtualGuest", "(", "virtual_id", ",", "id", "=", "ticket_id", ")" ]
Attach a virtual server to a ticket. :param integer ticket_id: the id of the ticket to attach to :param integer virtual_id: the id of the virtual server to attach :returns: dict -- The new ticket attachment
[ "Attach", "a", "virtual", "server", "to", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L118-L126
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.detach_hardware
def detach_hardware(self, ticket_id=None, hardware_id=None): """Detach hardware from a ticket. :param ticket_id: the id of the ticket to detach from :param hardware_id: the id of the hardware to detach :returns: bool -- Whether the detachment was successful """ return s...
python
def detach_hardware(self, ticket_id=None, hardware_id=None): """Detach hardware from a ticket. :param ticket_id: the id of the ticket to detach from :param hardware_id: the id of the hardware to detach :returns: bool -- Whether the detachment was successful """ return s...
[ "def", "detach_hardware", "(", "self", ",", "ticket_id", "=", "None", ",", "hardware_id", "=", "None", ")", ":", "return", "self", ".", "ticket", ".", "removeAttachedHardware", "(", "hardware_id", ",", "id", "=", "ticket_id", ")" ]
Detach hardware from a ticket. :param ticket_id: the id of the ticket to detach from :param hardware_id: the id of the hardware to detach :returns: bool -- Whether the detachment was successful
[ "Detach", "hardware", "from", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L128-L136
train
softlayer/softlayer-python
SoftLayer/managers/ticket.py
TicketManager.detach_virtual_server
def detach_virtual_server(self, ticket_id=None, virtual_id=None): """Detach a virtual server from a ticket. :param ticket_id: the id of the ticket to detach from :param virtual_id: the id of the virtual server to detach :returns: bool -- Whether the detachment was successful ""...
python
def detach_virtual_server(self, ticket_id=None, virtual_id=None): """Detach a virtual server from a ticket. :param ticket_id: the id of the ticket to detach from :param virtual_id: the id of the virtual server to detach :returns: bool -- Whether the detachment was successful ""...
[ "def", "detach_virtual_server", "(", "self", ",", "ticket_id", "=", "None", ",", "virtual_id", "=", "None", ")", ":", "return", "self", ".", "ticket", ".", "removeAttachedVirtualGuest", "(", "virtual_id", ",", "id", "=", "ticket_id", ")" ]
Detach a virtual server from a ticket. :param ticket_id: the id of the ticket to detach from :param virtual_id: the id of the virtual server to detach :returns: bool -- Whether the detachment was successful
[ "Detach", "a", "virtual", "server", "from", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/ticket.py#L138-L146
train
softlayer/softlayer-python
SoftLayer/CLI/subnet/detail.py
cli
def cli(env, identifier, no_vs, no_hardware): """Get subnet details.""" mgr = SoftLayer.NetworkManager(env.client) subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier, name='subnet') subnet = mgr.get_subnet(subnet_id) table = formatting.KeyValueTabl...
python
def cli(env, identifier, no_vs, no_hardware): """Get subnet details.""" mgr = SoftLayer.NetworkManager(env.client) subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier, name='subnet') subnet = mgr.get_subnet(subnet_id) table = formatting.KeyValueTabl...
[ "def", "cli", "(", "env", ",", "identifier", ",", "no_vs", ",", "no_hardware", ")", ":", "mgr", "=", "SoftLayer", ".", "NetworkManager", "(", "env", ".", "client", ")", "subnet_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "resolve_subnet_ids", ...
Get subnet details.
[ "Get", "subnet", "details", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/subnet/detail.py#L22-L72
train
softlayer/softlayer-python
SoftLayer/CLI/dns/zone_import.py
cli
def cli(env, zonefile, dry_run): """Import zone based off a BIND zone file.""" manager = SoftLayer.DNSManager(env.client) with open(zonefile) as zone_f: zone_contents = zone_f.read() zone, records, bad_lines = parse_zone_details(zone_contents) env.out("Parsed: zone=%s" % zone) for rec...
python
def cli(env, zonefile, dry_run): """Import zone based off a BIND zone file.""" manager = SoftLayer.DNSManager(env.client) with open(zonefile) as zone_f: zone_contents = zone_f.read() zone, records, bad_lines = parse_zone_details(zone_contents) env.out("Parsed: zone=%s" % zone) for rec...
[ "def", "cli", "(", "env", ",", "zonefile", ",", "dry_run", ")", ":", "manager", "=", "SoftLayer", ".", "DNSManager", "(", "env", ".", "client", ")", "with", "open", "(", "zonefile", ")", "as", "zone_f", ":", "zone_contents", "=", "zone_f", ".", "read",...
Import zone based off a BIND zone file.
[ "Import", "zone", "based", "off", "a", "BIND", "zone", "file", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/zone_import.py#L25-L68
train
softlayer/softlayer-python
SoftLayer/CLI/dns/zone_import.py
parse_zone_details
def parse_zone_details(zone_contents): """Parses a zone file into python data-structures.""" records = [] bad_lines = [] zone_lines = [line.strip() for line in zone_contents.split('\n')] zone_search = re.search(r'^\$ORIGIN (?P<zone>.*)\.', zone_lines[0]) zone = zone_search.group('zone') fo...
python
def parse_zone_details(zone_contents): """Parses a zone file into python data-structures.""" records = [] bad_lines = [] zone_lines = [line.strip() for line in zone_contents.split('\n')] zone_search = re.search(r'^\$ORIGIN (?P<zone>.*)\.', zone_lines[0]) zone = zone_search.group('zone') fo...
[ "def", "parse_zone_details", "(", "zone_contents", ")", ":", "records", "=", "[", "]", "bad_lines", "=", "[", "]", "zone_lines", "=", "[", "line", ".", "strip", "(", ")", "for", "line", "in", "zone_contents", ".", "split", "(", "'\\n'", ")", "]", "zone...
Parses a zone file into python data-structures.
[ "Parses", "a", "zone", "file", "into", "python", "data", "-", "structures", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/zone_import.py#L71-L117
train
softlayer/softlayer-python
SoftLayer/CLI/object_storage/list_accounts.py
cli
def cli(env): """List object storage accounts.""" mgr = SoftLayer.ObjectStorageManager(env.client) accounts = mgr.list_accounts() table = formatting.Table(['id', 'name', 'apiType']) table.sortby = 'id' api_type = None for account in accounts: if 'vendorName' in account and account['...
python
def cli(env): """List object storage accounts.""" mgr = SoftLayer.ObjectStorageManager(env.client) accounts = mgr.list_accounts() table = formatting.Table(['id', 'name', 'apiType']) table.sortby = 'id' api_type = None for account in accounts: if 'vendorName' in account and account['...
[ "def", "cli", "(", "env", ")", ":", "mgr", "=", "SoftLayer", ".", "ObjectStorageManager", "(", "env", ".", "client", ")", "accounts", "=", "mgr", ".", "list_accounts", "(", ")", "table", "=", "formatting", ".", "Table", "(", "[", "'id'", ",", "'name'",...
List object storage accounts.
[ "List", "object", "storage", "accounts", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/object_storage/list_accounts.py#L13-L33
train
softlayer/softlayer-python
SoftLayer/CLI/dns/zone_create.py
cli
def cli(env, zone): """Create a zone.""" manager = SoftLayer.DNSManager(env.client) manager.create_zone(zone)
python
def cli(env, zone): """Create a zone.""" manager = SoftLayer.DNSManager(env.client) manager.create_zone(zone)
[ "def", "cli", "(", "env", ",", "zone", ")", ":", "manager", "=", "SoftLayer", ".", "DNSManager", "(", "env", ".", "client", ")", "manager", ".", "create_zone", "(", "zone", ")" ]
Create a zone.
[ "Create", "a", "zone", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/dns/zone_create.py#L13-L17
train
softlayer/softlayer-python
SoftLayer/CLI/loadbal/create.py
cli
def cli(env, billing_id, datacenter): """Adds a load balancer given the id returned from create-options.""" mgr = SoftLayer.LoadBalancerManager(env.client) if not formatting.confirm("This action will incur charges on your " "account. Continue?"): raise exceptions.CLIAb...
python
def cli(env, billing_id, datacenter): """Adds a load balancer given the id returned from create-options.""" mgr = SoftLayer.LoadBalancerManager(env.client) if not formatting.confirm("This action will incur charges on your " "account. Continue?"): raise exceptions.CLIAb...
[ "def", "cli", "(", "env", ",", "billing_id", ",", "datacenter", ")", ":", "mgr", "=", "SoftLayer", ".", "LoadBalancerManager", "(", "env", ".", "client", ")", "if", "not", "formatting", ".", "confirm", "(", "\"This action will incur charges on your \"", "\"accou...
Adds a load balancer given the id returned from create-options.
[ "Adds", "a", "load", "balancer", "given", "the", "id", "returned", "from", "create", "-", "options", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/create.py#L17-L25
train
softlayer/softlayer-python
SoftLayer/CLI/loadbal/group_reset.py
cli
def cli(env, identifier): """Reset connections on a certain service group.""" mgr = SoftLayer.LoadBalancerManager(env.client) loadbal_id, group_id = loadbal.parse_id(identifier) mgr.reset_service_group(loadbal_id, group_id) env.fout('Load balancer service group connections are being reset!')
python
def cli(env, identifier): """Reset connections on a certain service group.""" mgr = SoftLayer.LoadBalancerManager(env.client) loadbal_id, group_id = loadbal.parse_id(identifier) mgr.reset_service_group(loadbal_id, group_id) env.fout('Load balancer service group connections are being reset!')
[ "def", "cli", "(", "env", ",", "identifier", ")", ":", "mgr", "=", "SoftLayer", ".", "LoadBalancerManager", "(", "env", ".", "client", ")", "loadbal_id", ",", "group_id", "=", "loadbal", ".", "parse_id", "(", "identifier", ")", "mgr", ".", "reset_service_g...
Reset connections on a certain service group.
[ "Reset", "connections", "on", "a", "certain", "service", "group", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/loadbal/group_reset.py#L14-L21
train
softlayer/softlayer-python
SoftLayer/CLI/ticket/upload.py
cli
def cli(env, identifier, path, name): """Adds an attachment to an existing ticket.""" mgr = SoftLayer.TicketManager(env.client) ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket') if path is None: raise exceptions.ArgumentError("Missing argument --path") if not os.path.e...
python
def cli(env, identifier, path, name): """Adds an attachment to an existing ticket.""" mgr = SoftLayer.TicketManager(env.client) ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket') if path is None: raise exceptions.ArgumentError("Missing argument --path") if not os.path.e...
[ "def", "cli", "(", "env", ",", "identifier", ",", "path", ",", "name", ")", ":", "mgr", "=", "SoftLayer", ".", "TicketManager", "(", "env", ".", "client", ")", "ticket_id", "=", "helpers", ".", "resolve_id", "(", "mgr", ".", "resolve_ids", ",", "identi...
Adds an attachment to an existing ticket.
[ "Adds", "an", "attachment", "to", "an", "existing", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/upload.py#L19-L37
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
has_firewall
def has_firewall(vlan): """Helper to determine whether or not a VLAN has a firewall. :param dict vlan: A dictionary representing a VLAN :returns: True if the VLAN has a firewall, false if it doesn't. """ return bool( vlan.get('dedicatedFirewallFlag', None) or vlan.get('highAvailabil...
python
def has_firewall(vlan): """Helper to determine whether or not a VLAN has a firewall. :param dict vlan: A dictionary representing a VLAN :returns: True if the VLAN has a firewall, false if it doesn't. """ return bool( vlan.get('dedicatedFirewallFlag', None) or vlan.get('highAvailabil...
[ "def", "has_firewall", "(", "vlan", ")", ":", "return", "bool", "(", "vlan", ".", "get", "(", "'dedicatedFirewallFlag'", ",", "None", ")", "or", "vlan", ".", "get", "(", "'highAvailabilityFirewallFlag'", ",", "None", ")", "or", "vlan", ".", "get", "(", "...
Helper to determine whether or not a VLAN has a firewall. :param dict vlan: A dictionary representing a VLAN :returns: True if the VLAN has a firewall, false if it doesn't.
[ "Helper", "to", "determine", "whether", "or", "not", "a", "VLAN", "has", "a", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L17-L29
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.get_standard_package
def get_standard_package(self, server_id, is_virt=True): """Retrieves the standard firewall package for the virtual server. :param int server_id: The ID of the server to create the firewall for :param bool is_virt: True if the ID provided is for a virtual server, Fa...
python
def get_standard_package(self, server_id, is_virt=True): """Retrieves the standard firewall package for the virtual server. :param int server_id: The ID of the server to create the firewall for :param bool is_virt: True if the ID provided is for a virtual server, Fa...
[ "def", "get_standard_package", "(", "self", ",", "server_id", ",", "is_virt", "=", "True", ")", ":", "firewall_port_speed", "=", "self", ".", "_get_fwl_port_speed", "(", "server_id", ",", "is_virt", ")", "_value", "=", "\"%s%s\"", "%", "(", "firewall_port_speed"...
Retrieves the standard firewall package for the virtual server. :param int server_id: The ID of the server to create the firewall for :param bool is_virt: True if the ID provided is for a virtual server, False for a server :returns: A dictionary containing the stand...
[ "Retrieves", "the", "standard", "firewall", "package", "for", "the", "virtual", "server", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L46-L61
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.get_dedicated_package
def get_dedicated_package(self, ha_enabled=False): """Retrieves the dedicated firewall package. :param bool ha_enabled: True if HA is to be enabled on the firewall False for No HA :returns: A dictionary containing the dedicated virtual server firewall ...
python
def get_dedicated_package(self, ha_enabled=False): """Retrieves the dedicated firewall package. :param bool ha_enabled: True if HA is to be enabled on the firewall False for No HA :returns: A dictionary containing the dedicated virtual server firewall ...
[ "def", "get_dedicated_package", "(", "self", ",", "ha_enabled", "=", "False", ")", ":", "fwl_filter", "=", "'Hardware Firewall (Dedicated)'", "ha_fwl_filter", "=", "'Hardware Firewall (High Availability)'", "_filter", "=", "utils", ".", "NestedDict", "(", "{", "}", ")...
Retrieves the dedicated firewall package. :param bool ha_enabled: True if HA is to be enabled on the firewall False for No HA :returns: A dictionary containing the dedicated virtual server firewall package
[ "Retrieves", "the", "dedicated", "firewall", "package", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L63-L80
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.cancel_firewall
def cancel_firewall(self, firewall_id, dedicated=False): """Cancels the specified firewall. :param int firewall_id: Firewall ID to be cancelled. :param bool dedicated: If true, the firewall instance is dedicated, otherwise, the firewall instance is shared. ...
python
def cancel_firewall(self, firewall_id, dedicated=False): """Cancels the specified firewall. :param int firewall_id: Firewall ID to be cancelled. :param bool dedicated: If true, the firewall instance is dedicated, otherwise, the firewall instance is shared. ...
[ "def", "cancel_firewall", "(", "self", ",", "firewall_id", ",", "dedicated", "=", "False", ")", ":", "fwl_billing", "=", "self", ".", "_get_fwl_billing_item", "(", "firewall_id", ",", "dedicated", ")", "billing_item_service", "=", "self", ".", "client", "[", "...
Cancels the specified firewall. :param int firewall_id: Firewall ID to be cancelled. :param bool dedicated: If true, the firewall instance is dedicated, otherwise, the firewall instance is shared.
[ "Cancels", "the", "specified", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L82-L92
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.add_vlan_firewall
def add_vlan_firewall(self, vlan_id, ha_enabled=False): """Creates a firewall for the specified vlan. :param int vlan_id: The ID of the vlan to create the firewall for :param bool ha_enabled: If True, an HA firewall will be created :returns: A dictionary containing the VLAN firewall or...
python
def add_vlan_firewall(self, vlan_id, ha_enabled=False): """Creates a firewall for the specified vlan. :param int vlan_id: The ID of the vlan to create the firewall for :param bool ha_enabled: If True, an HA firewall will be created :returns: A dictionary containing the VLAN firewall or...
[ "def", "add_vlan_firewall", "(", "self", ",", "vlan_id", ",", "ha_enabled", "=", "False", ")", ":", "package", "=", "self", ".", "get_dedicated_package", "(", "ha_enabled", ")", "product_order", "=", "{", "'complexType'", ":", "'SoftLayer_Container_Product_Order_Net...
Creates a firewall for the specified vlan. :param int vlan_id: The ID of the vlan to create the firewall for :param bool ha_enabled: If True, an HA firewall will be created :returns: A dictionary containing the VLAN firewall order
[ "Creates", "a", "firewall", "for", "the", "specified", "vlan", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L125-L143
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager._get_fwl_billing_item
def _get_fwl_billing_item(self, firewall_id, dedicated=False): """Retrieves the billing item of the firewall. :param int firewall_id: Firewall ID to get the billing item for :param bool dedicated: whether the firewall is dedicated or standard :returns: A dictionary of the firewall billi...
python
def _get_fwl_billing_item(self, firewall_id, dedicated=False): """Retrieves the billing item of the firewall. :param int firewall_id: Firewall ID to get the billing item for :param bool dedicated: whether the firewall is dedicated or standard :returns: A dictionary of the firewall billi...
[ "def", "_get_fwl_billing_item", "(", "self", ",", "firewall_id", ",", "dedicated", "=", "False", ")", ":", "mask", "=", "'mask[id,billingItem[id]]'", "if", "dedicated", ":", "firewall_service", "=", "self", ".", "client", "[", "'Network_Vlan_Firewall'", "]", "else...
Retrieves the billing item of the firewall. :param int firewall_id: Firewall ID to get the billing item for :param bool dedicated: whether the firewall is dedicated or standard :returns: A dictionary of the firewall billing item.
[ "Retrieves", "the", "billing", "item", "of", "the", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L145-L166
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager._get_fwl_port_speed
def _get_fwl_port_speed(self, server_id, is_virt=True): """Determines the appropriate speed for a firewall. :param int server_id: The ID of server the firewall is for :param bool is_virt: True if the server_id is for a virtual server :returns: a integer representing the Mbps speed of a ...
python
def _get_fwl_port_speed(self, server_id, is_virt=True): """Determines the appropriate speed for a firewall. :param int server_id: The ID of server the firewall is for :param bool is_virt: True if the server_id is for a virtual server :returns: a integer representing the Mbps speed of a ...
[ "def", "_get_fwl_port_speed", "(", "self", ",", "server_id", ",", "is_virt", "=", "True", ")", ":", "fwl_port_speed", "=", "0", "if", "is_virt", ":", "mask", "=", "(", "'primaryNetworkComponent[maxSpeed]'", ")", "svc", "=", "self", ".", "client", "[", "'Virt...
Determines the appropriate speed for a firewall. :param int server_id: The ID of server the firewall is for :param bool is_virt: True if the server_id is for a virtual server :returns: a integer representing the Mbps speed of a firewall
[ "Determines", "the", "appropriate", "speed", "for", "a", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L168-L212
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.get_firewalls
def get_firewalls(self): """Returns a list of all firewalls on the account. :returns: A list of firewalls on the current account. """ mask = ('firewallNetworkComponents,' 'networkVlanFirewall,' 'dedicatedFirewallFlag,' 'firewallGuestNetwo...
python
def get_firewalls(self): """Returns a list of all firewalls on the account. :returns: A list of firewalls on the current account. """ mask = ('firewallNetworkComponents,' 'networkVlanFirewall,' 'dedicatedFirewallFlag,' 'firewallGuestNetwo...
[ "def", "get_firewalls", "(", "self", ")", ":", "mask", "=", "(", "'firewallNetworkComponents,'", "'networkVlanFirewall,'", "'dedicatedFirewallFlag,'", "'firewallGuestNetworkComponents,'", "'firewallInterfaces,'", "'firewallRules,'", "'highAvailabilityFirewallFlag'", ")", "return", ...
Returns a list of all firewalls on the account. :returns: A list of firewalls on the current account.
[ "Returns", "a", "list", "of", "all", "firewalls", "on", "the", "account", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L214-L230
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.get_standard_fwl_rules
def get_standard_fwl_rules(self, firewall_id): """Get the rules of a standard firewall. :param integer firewall_id: the instance ID of the standard firewall :returns: A list of the rules. """ svc = self.client['Network_Component_Firewall'] return svc.getRules(id=firewal...
python
def get_standard_fwl_rules(self, firewall_id): """Get the rules of a standard firewall. :param integer firewall_id: the instance ID of the standard firewall :returns: A list of the rules. """ svc = self.client['Network_Component_Firewall'] return svc.getRules(id=firewal...
[ "def", "get_standard_fwl_rules", "(", "self", ",", "firewall_id", ")", ":", "svc", "=", "self", ".", "client", "[", "'Network_Component_Firewall'", "]", "return", "svc", ".", "getRules", "(", "id", "=", "firewall_id", ",", "mask", "=", "RULE_MASK", ")" ]
Get the rules of a standard firewall. :param integer firewall_id: the instance ID of the standard firewall :returns: A list of the rules.
[ "Get", "the", "rules", "of", "a", "standard", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L232-L240
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.edit_dedicated_fwl_rules
def edit_dedicated_fwl_rules(self, firewall_id, rules): """Edit the rules for dedicated firewall. :param integer firewall_id: the instance ID of the dedicated firewall :param list rules: the rules to be pushed on the firewall as defined by SoftLayer_Network_Firewall_U...
python
def edit_dedicated_fwl_rules(self, firewall_id, rules): """Edit the rules for dedicated firewall. :param integer firewall_id: the instance ID of the dedicated firewall :param list rules: the rules to be pushed on the firewall as defined by SoftLayer_Network_Firewall_U...
[ "def", "edit_dedicated_fwl_rules", "(", "self", ",", "firewall_id", ",", "rules", ")", ":", "mask", "=", "(", "'mask[networkVlan[firewallInterfaces'", "'[firewallContextAccessControlLists]]]'", ")", "svc", "=", "self", ".", "client", "[", "'Network_Vlan_Firewall'", "]",...
Edit the rules for dedicated firewall. :param integer firewall_id: the instance ID of the dedicated firewall :param list rules: the rules to be pushed on the firewall as defined by SoftLayer_Network_Firewall_Update_Request_Rule
[ "Edit", "the", "rules", "for", "dedicated", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L252-L279
train
softlayer/softlayer-python
SoftLayer/managers/firewall.py
FirewallManager.edit_standard_fwl_rules
def edit_standard_fwl_rules(self, firewall_id, rules): """Edit the rules for standard firewall. :param integer firewall_id: the instance ID of the standard firewall :param dict rules: the rules to be pushed on the firewall """ rule_svc = self.client['Network_Firewall_Update_Req...
python
def edit_standard_fwl_rules(self, firewall_id, rules): """Edit the rules for standard firewall. :param integer firewall_id: the instance ID of the standard firewall :param dict rules: the rules to be pushed on the firewall """ rule_svc = self.client['Network_Firewall_Update_Req...
[ "def", "edit_standard_fwl_rules", "(", "self", ",", "firewall_id", ",", "rules", ")", ":", "rule_svc", "=", "self", ".", "client", "[", "'Network_Firewall_Update_Request'", "]", "template", "=", "{", "'networkComponentFirewallId'", ":", "firewall_id", ",", "'rules'"...
Edit the rules for standard firewall. :param integer firewall_id: the instance ID of the standard firewall :param dict rules: the rules to be pushed on the firewall
[ "Edit", "the", "rules", "for", "standard", "firewall", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/managers/firewall.py#L281-L291
train
softlayer/softlayer-python
SoftLayer/CLI/image/edit.py
cli
def cli(env, identifier, name, note, tag): """Edit details of an image.""" image_mgr = SoftLayer.ImageManager(env.client) data = {} if name: data['name'] = name if note: data['note'] = note if tag: data['tag'] = tag image_id = helpers.resolve_id(image_mgr.resolve_ids...
python
def cli(env, identifier, name, note, tag): """Edit details of an image.""" image_mgr = SoftLayer.ImageManager(env.client) data = {} if name: data['name'] = name if note: data['note'] = note if tag: data['tag'] = tag image_id = helpers.resolve_id(image_mgr.resolve_ids...
[ "def", "cli", "(", "env", ",", "identifier", ",", "name", ",", "note", ",", "tag", ")", ":", "image_mgr", "=", "SoftLayer", ".", "ImageManager", "(", "env", ".", "client", ")", "data", "=", "{", "}", "if", "name", ":", "data", "[", "'name'", "]", ...
Edit details of an image.
[ "Edit", "details", "of", "an", "image", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/image/edit.py#L18-L31
train
softlayer/softlayer-python
SoftLayer/CLI/ticket/attach.py
cli
def cli(env, identifier, hardware_identifier, virtual_identifier): """Attach devices to a ticket.""" ticket_mgr = SoftLayer.TicketManager(env.client) if hardware_identifier and virtual_identifier: raise exceptions.ArgumentError("Cannot attach hardware and a virtual server at the same time") if...
python
def cli(env, identifier, hardware_identifier, virtual_identifier): """Attach devices to a ticket.""" ticket_mgr = SoftLayer.TicketManager(env.client) if hardware_identifier and virtual_identifier: raise exceptions.ArgumentError("Cannot attach hardware and a virtual server at the same time") if...
[ "def", "cli", "(", "env", ",", "identifier", ",", "hardware_identifier", ",", "virtual_identifier", ")", ":", "ticket_mgr", "=", "SoftLayer", ".", "TicketManager", "(", "env", ".", "client", ")", "if", "hardware_identifier", "and", "virtual_identifier", ":", "ra...
Attach devices to a ticket.
[ "Attach", "devices", "to", "a", "ticket", "." ]
9f181be08cc3668353b05a6de0cb324f52cff6fa
https://github.com/softlayer/softlayer-python/blob/9f181be08cc3668353b05a6de0cb324f52cff6fa/SoftLayer/CLI/ticket/attach.py#L19-L35
train