idx int64 0 252k | question stringlengths 48 5.28k | target stringlengths 5 1.23k |
|---|---|---|
234,300 | def get_invoices ( self , limit = 50 , closed = False , get_all = False ) : mask = "mask[invoiceTotalAmount, itemCount]" _filter = { 'invoices' : { 'createDate' : { 'operation' : 'orderBy' , 'options' : [ { 'name' : 'sort' , 'value' : [ 'DESC' ] } ] } , 'statusCode' : { 'operation' : 'OPEN' } , } } if closed : del _fil... | Gets an accounts invoices . |
234,301 | def cli ( env ) : mgr = SoftLayer . LoadBalancerManager ( env . client ) table = formatting . Table ( [ 'price_id' , 'capacity' , 'description' , 'price' ] ) table . sortby = 'price' table . align [ 'price' ] = 'r' table . align [ 'capacity' ] = 'r' table . align [ 'id' ] = 'r' packages = mgr . get_lb_pkgs ( ) for pack... | Get price options to create a load balancer with . |
234,302 | def cli ( env , identifier ) : vsi = SoftLayer . VSManager ( env . client ) vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , 'VS' ) instance = vsi . get_instance ( vs_id ) table = formatting . Table ( [ 'username' , 'password' ] ) for item in instance [ 'operatingSystem' ] [ 'passwords' ] : table . add_r... | List virtual server credentials . |
234,303 | def cli ( env , zone_id , by_record , by_id , data , ttl ) : manager = SoftLayer . DNSManager ( env . client ) zone_id = helpers . resolve_id ( manager . resolve_ids , zone_id , name = 'zone' ) results = manager . get_records ( zone_id , host = by_record ) for result in results : if by_id and str ( result [ 'id' ] ) !=... | Update DNS record . |
234,304 | def cli ( env , identifier , wait ) : compute = SoftLayer . HardwareManager ( env . client ) compute_id = helpers . resolve_id ( compute . resolve_ids , identifier , 'hardware' ) ready = compute . wait_for_ready ( compute_id , wait ) if ready : env . fout ( "READY" ) else : raise exceptions . CLIAbort ( "Server %s not ... | Check if a server is ready . |
234,305 | def cli ( env ) : mask = ( 'openTicketCount, closedTicketCount, ' 'openBillingTicketCount, openOtherTicketCount, ' 'openSalesTicketCount, openSupportTicketCount, ' 'openAccountingTicketCount' ) account = env . client [ 'Account' ] . getObject ( mask = mask ) table = formatting . Table ( [ 'Status' , 'count' ] ) nested ... | Summary info about tickets . |
234,306 | def cli ( env , ip_version ) : mgr = SoftLayer . NetworkManager ( env . client ) table = formatting . Table ( [ 'id' , 'ip' , 'assigned' , 'target' ] ) version = None if ip_version == 'v4' : version = 4 elif ip_version == 'v6' : version = 6 ips = mgr . list_global_ips ( version = version ) for ip_address in ips : assig... | List all global IPs . |
234,307 | def cli ( env , identifier ) : mgr = SoftLayer . NetworkManager ( env . client ) global_ip_id = helpers . resolve_id ( mgr . resolve_global_ip_ids , identifier , name = 'global ip' ) if not ( env . skip_confirmations or formatting . no_going_back ( global_ip_id ) ) : raise exceptions . CLIAbort ( 'Aborted' ) mgr . canc... | Cancel global IP . |
234,308 | def create_client_from_env ( username = None , api_key = None , endpoint_url = None , timeout = None , auth = None , config_file = None , proxy = None , user_agent = None , transport = None , verify = True ) : settings = config . get_client_settings ( username = username , api_key = api_key , endpoint_url = endpoint_ur... | Creates a SoftLayer API client using your environment . |
234,309 | def call ( self , service , method , * args , ** kwargs ) : if kwargs . pop ( 'iter' , False ) : return list ( self . iter_call ( service , method , * args , ** kwargs ) ) invalid_kwargs = set ( kwargs . keys ( ) ) - VALID_CALL_ARGS if invalid_kwargs : raise TypeError ( 'Invalid keyword arguments: %s' % ',' . join ( in... | Make a SoftLayer API call . |
234,310 | def call ( self , name , * args , ** kwargs ) : return self . client . call ( self . name , name , * args , ** kwargs ) | Make a SoftLayer API call |
234,311 | def cli ( env , identifier ) : mgr = SoftLayer . ObjectStorageManager ( env . client ) credential_list = mgr . list_credential ( identifier ) table = formatting . Table ( [ 'id' , 'password' , 'username' , 'type_name' ] ) for credential in credential_list : table . add_row ( [ credential [ 'id' ] , credential [ 'passwo... | Retrieve credentials used for generating an AWS signature . Max of 2 . |
234,312 | def cli ( env , sortby , cpu , columns , datacenter , name , memory , disk , tag ) : mgr = SoftLayer . DedicatedHostManager ( env . client ) hosts = mgr . list_instances ( cpus = cpu , datacenter = datacenter , hostname = name , memory = memory , disk = disk , tags = tag , mask = columns . mask ( ) ) table = formatting... | List dedicated host . |
234,313 | def input ( self , prompt , default = None , show_default = True ) : return click . prompt ( prompt , default = default , show_default = show_default ) | Provide a command prompt . |
234,314 | def getpass ( self , prompt , default = None ) : return click . prompt ( prompt , hide_input = True , default = default ) | Provide a password prompt . |
234,315 | def list_commands ( self , * path ) : path_str = ':' . join ( path ) commands = [ ] for command in self . commands : if all ( [ command . startswith ( path_str ) , len ( path ) == command . count ( ":" ) ] ) : offset = len ( path_str ) + 1 if path_str else 0 commands . append ( command [ offset : ] ) return sorted ( co... | Command listing . |
234,316 | def get_command ( self , * path ) : path_str = ':' . join ( path ) if path_str in self . commands : return self . commands [ path_str ] . load ( ) return None | Return command at the given path or raise error . |
234,317 | def resolve_alias ( self , path_str ) : if path_str in self . aliases : return self . aliases [ path_str ] return path_str | Returns the actual command name . Uses the alias mapping . |
234,318 | def load ( self ) : if self . _modules_loaded is True : return self . load_modules_from_python ( routes . ALL_ROUTES ) self . aliases . update ( routes . ALL_ALIASES ) self . _load_modules_from_entry_points ( 'softlayer.cli' ) self . _modules_loaded = True | Loads all modules . |
234,319 | def load_modules_from_python ( self , route_list ) : for name , modpath in route_list : if ':' in modpath : path , attr = modpath . split ( ':' , 1 ) else : path , attr = modpath , None self . commands [ name ] = ModuleLoader ( path , attr = attr ) | Load modules from the native python source . |
234,320 | def ensure_client ( self , config_file = None , is_demo = False , proxy = None ) : if self . client is not None : return if is_demo : client = SoftLayer . BaseClient ( transport = SoftLayer . FixtureTransport ( ) , auth = None , ) else : client = SoftLayer . create_client_from_env ( proxy = proxy , config_file = config... | Create a new SLAPI client to the environment . |
234,321 | def multi_option ( * param_decls , ** attrs ) : attrhelp = attrs . get ( 'help' , None ) if attrhelp is not None : newhelp = attrhelp + " (multiple occurrence permitted)" attrs [ 'help' ] = newhelp attrs [ 'multiple' ] = True return click . option ( * param_decls , ** attrs ) | modify help text and indicate option is permitted multiple times |
234,322 | def resolve_id ( resolver , identifier , name = 'object' ) : try : return int ( identifier ) except ValueError : pass ids = resolver ( identifier ) if len ( ids ) == 0 : raise exceptions . CLIAbort ( "Error: Unable to find %s '%s'" % ( name , identifier ) ) if len ( ids ) > 1 : raise exceptions . CLIAbort ( "Error: Mul... | Resolves a single id using a resolver function . |
234,323 | def cli ( env , identifier ) : manager = SoftLayer . SSLManager ( env . client ) if not ( env . skip_confirmations or formatting . no_going_back ( 'yes' ) ) : raise exceptions . CLIAbort ( "Aborted." ) manager . remove_certificate ( identifier ) | Remove SSL certificate . |
234,324 | def cli ( env , volume_id , capacity , tier , upgrade ) : file_manager = SoftLayer . FileStorageManager ( env . client ) if tier is not None : tier = float ( tier ) try : order = file_manager . order_snapshot_space ( volume_id , capacity = capacity , tier = tier , upgrade = upgrade ) except ValueError as ex : raise exc... | Order snapshot space for a file storage volume . |
234,325 | def cli ( env , identifier , domain , userfile , tag , hostname , userdata , public_speed , private_speed ) : if userdata and userfile : raise exceptions . ArgumentError ( '[-u | --userdata] not allowed with [-F | --userfile]' ) data = { } if userdata : data [ 'userdata' ] = userdata elif userfile : with open ( userfil... | Edit a virtual server s details . |
234,326 | def cli ( env , volume_id , snapshot_schedule , location , tier ) : file_manager = SoftLayer . FileStorageManager ( env . client ) if tier is not None : tier = float ( tier ) try : order = file_manager . order_replicant_volume ( volume_id , snapshot_schedule = snapshot_schedule , location = location , tier = tier , ) e... | Order a file storage replica volume . |
234,327 | def cli ( env , volume_id , replicant_id ) : block_storage_manager = SoftLayer . BlockStorageManager ( env . client ) success = block_storage_manager . failback_from_replicant ( volume_id , replicant_id ) if success : click . echo ( "Failback from replicant is now in progress." ) else : click . echo ( "Failback operati... | Failback a block volume from the given replicant volume . |
234,328 | def cli ( env , identifier ) : manager = PlacementManager ( env . client ) group_id = helpers . resolve_id ( manager . resolve_ids , identifier , 'placement_group' ) result = manager . get_object ( group_id ) table = formatting . Table ( [ "Id" , "Name" , "Backend Router" , "Rule" , "Created" ] ) table . add_row ( [ re... | View details of a placement group . |
234,329 | def cli ( env , columns ) : mgr = SoftLayer . UserManager ( env . client ) users = mgr . list_users ( ) table = formatting . Table ( columns . columns ) for user in users : table . add_row ( [ value or formatting . blank ( ) for value in columns . row ( user ) ] ) env . fout ( table ) | List Users . |
234,330 | def cli ( env , identifier , body ) : mgr = SoftLayer . TicketManager ( env . client ) ticket_id = helpers . resolve_id ( mgr . resolve_ids , identifier , 'ticket' ) if body is None : body = click . edit ( '\n\n' + ticket . TEMPLATE_MSG ) mgr . update_ticket ( ticket_id = ticket_id , body = body ) env . fout ( "Ticket ... | Adds an update to an existing ticket . |
234,331 | def cli ( env , quote ) : manager = ordering . OrderingManager ( env . client ) result = manager . get_quote_details ( quote ) package = result [ 'order' ] [ 'items' ] [ 0 ] [ 'package' ] title = "{} - Package: {}, Id {}" . format ( result . get ( 'name' ) , package [ 'keyName' ] , package [ 'id' ] ) table = formatting... | View a quote |
234,332 | def cli ( env , sortby , limit ) : mgr = SoftLayer . NetworkManager ( env . client ) table = formatting . Table ( COLUMNS ) table . sortby = sortby sgs = mgr . list_securitygroups ( limit = limit ) for secgroup in sgs : table . add_row ( [ secgroup [ 'id' ] , secgroup . get ( 'name' ) or formatting . blank ( ) , secgro... | List security groups . |
234,333 | def parse_rules ( content = None ) : rules = content . split ( DELIMITER ) parsed_rules = list ( ) order = 1 for rule in rules : if rule . strip ( ) == '' : continue parsed_rule = { } lines = rule . split ( "\n" ) parsed_rule [ 'orderValue' ] = order order += 1 for line in lines : if line . strip ( ) == '' : continue k... | Helper to parse the input from the user into a list of rules . |
234,334 | def open_editor ( rules = None , content = None ) : editor = os . environ . get ( 'EDITOR' , 'nano' ) with tempfile . NamedTemporaryFile ( suffix = ".tmp" ) as tfile : if content : tfile . write ( content ) tfile . flush ( ) subprocess . call ( [ editor , tfile . name ] ) tfile . seek ( 0 ) data = tfile . read ( ) retu... | Helper to open an editor for editing the firewall rules . |
234,335 | def get_formatted_rule ( rule = None ) : rule = rule or { } return ( 'action: %s\n' 'protocol: %s\n' 'source_ip_address: %s\n' 'source_ip_subnet_mask: %s\n' 'destination_ip_address: %s\n' 'destination_ip_subnet_mask: %s\n' 'destination_port_range_start: %s\n' 'destination_port_range_end: %s\n' 'version: %s\n' % ( rule ... | Helper to format the rule into a user friendly format . |
234,336 | def cli ( env , identifier ) : mgr = SoftLayer . FirewallManager ( env . client ) firewall_type , firewall_id = firewall . parse_id ( identifier ) if firewall_type == 'vlan' : orig_rules = mgr . get_dedicated_fwl_rules ( firewall_id ) else : orig_rules = mgr . get_standard_fwl_rules ( firewall_id ) edited_rules = open_... | Edit firewall rules . |
234,337 | def rule_list ( env , securitygroup_id , sortby ) : mgr = SoftLayer . NetworkManager ( env . client ) table = formatting . Table ( COLUMNS ) table . sortby = sortby rules = mgr . list_securitygroup_rules ( securitygroup_id ) for rule in rules : port_min = rule . get ( 'portRangeMin' ) port_max = rule . get ( 'portRange... | List security group rules . |
234,338 | def add ( env , securitygroup_id , remote_ip , remote_group , direction , ethertype , port_max , port_min , protocol ) : mgr = SoftLayer . NetworkManager ( env . client ) ret = mgr . add_securitygroup_rule ( securitygroup_id , remote_ip , remote_group , direction , ethertype , port_max , port_min , protocol ) if not re... | Add a security group rule to a security group . |
234,339 | def edit ( env , securitygroup_id , rule_id , remote_ip , remote_group , direction , ethertype , port_max , port_min , protocol ) : mgr = SoftLayer . NetworkManager ( env . client ) data = { } if remote_ip : data [ 'remote_ip' ] = remote_ip if remote_group : data [ 'remote_group' ] = remote_group if direction : data [ ... | Edit a security group rule in a security group . |
234,340 | def remove ( env , securitygroup_id , rule_id ) : mgr = SoftLayer . NetworkManager ( env . client ) ret = mgr . remove_securitygroup_rule ( securitygroup_id , rule_id ) if not ret : raise exceptions . CLIAbort ( "Failed to remove security group rule" ) table = formatting . Table ( REQUEST_BOOL_COLUMNS ) table . add_row... | Remove a rule from a security group . |
234,341 | def main ( ) : print ( "ERROR: Use the 'slcli' command instead." , file = sys . stderr ) print ( "> slcli %s" % ' ' . join ( sys . argv [ 1 : ] ) , file = sys . stderr ) exit ( - 1 ) | Main function for the deprecated sl command . |
234,342 | def cli ( env , identifier , allocation , port , routing_type , routing_method ) : mgr = SoftLayer . LoadBalancerManager ( env . client ) loadbal_id , group_id = loadbal . parse_id ( identifier ) if not any ( [ allocation , port , routing_type , routing_method ] ) : raise exceptions . CLIAbort ( 'At least one property ... | Edit an existing load balancer service group . |
234,343 | def cli ( env , identifier , ack ) : manager = AccountManager ( env . client ) event = manager . get_event ( identifier ) if ack : manager . ack_event ( identifier ) env . fout ( basic_event_table ( event ) ) env . fout ( impacted_table ( event ) ) env . fout ( update_table ( event ) ) | Details of a specific event and ability to acknowledge event . |
234,344 | def basic_event_table ( event ) : table = formatting . Table ( [ "Id" , "Status" , "Type" , "Start" , "End" ] , title = utils . clean_splitlines ( event . get ( 'subject' ) ) ) table . add_row ( [ event . get ( 'id' ) , utils . lookup ( event , 'statusCode' , 'name' ) , utils . lookup ( event , 'notificationOccurrenceE... | Formats a basic event table |
234,345 | def impacted_table ( event ) : table = formatting . Table ( [ "Type" , "Id" , "Hostname" , "PrivateIp" , "Label" ] ) for item in event . get ( 'impactedResources' , [ ] ) : table . add_row ( [ item . get ( 'resourceType' ) , item . get ( 'resourceTableId' ) , item . get ( 'hostname' ) , item . get ( 'privateIp' ) , ite... | Formats a basic impacted resources table |
234,346 | def update_table ( event ) : update_number = 0 for update in event . get ( 'updates' , [ ] ) : header = "======= Update #%s on %s =======" % ( update_number , utils . clean_time ( update . get ( 'startDate' ) ) ) click . secho ( header , fg = 'green' ) update_number = update_number + 1 text = update . get ( 'contents' ... | Formats a basic event update table |
234,347 | def cli ( env , sortby , columns , datacenter , username , storage_type ) : block_manager = SoftLayer . BlockStorageManager ( env . client ) block_volumes = block_manager . list_block_volumes ( datacenter = datacenter , username = username , storage_type = storage_type , mask = columns . mask ( ) ) table = formatting .... | List block storage . |
234,348 | def cli ( env ) : mgr = SoftLayer . ObjectStorageManager ( env . client ) endpoints = mgr . list_endpoints ( ) table = formatting . Table ( [ 'datacenter' , 'public' , 'private' ] ) for endpoint in endpoints : table . add_row ( [ endpoint [ 'datacenter' ] [ 'name' ] , endpoint [ 'public' ] , endpoint [ 'private' ] , ] ... | List object storage endpoints . |
234,349 | def cli ( env , identifier ) : vsi = SoftLayer . VSManager ( env . client ) vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , 'VS' ) if not ( env . skip_confirmations or formatting . no_going_back ( vs_id ) ) : raise exceptions . CLIAbort ( 'Aborted' ) vsi . cancel_instance ( vs_id ) | Cancel virtual servers . |
234,350 | def cli ( env , identifier ) : mgr = SoftLayer . HardwareManager ( env . client ) hw_id = helpers . resolve_id ( mgr . resolve_ids , identifier , 'hardware' ) if not ( env . skip_confirmations or formatting . confirm ( 'This will power off the server with id %s and ' 'reflash device firmware. Continue?' % hw_id ) ) : r... | Reflash server firmware . |
234,351 | def cli ( env , volume_id ) : file_manager = SoftLayer . FileStorageManager ( env . client ) snapshot_schedules = file_manager . list_volume_schedules ( volume_id ) table = formatting . Table ( [ 'id' , 'active' , 'type' , 'replication' , 'date_created' , 'minute' , 'hour' , 'day' , 'week' , 'day_of_week' , 'date_of_mo... | Lists snapshot schedules for a given volume |
234,352 | def cli ( env ) : mgr = SoftLayer . FirewallManager ( env . client ) table = formatting . Table ( [ 'firewall id' , 'type' , 'features' , 'server/vlan id' ] ) fwvlans = mgr . get_firewalls ( ) dedicated_firewalls = [ firewall for firewall in fwvlans if firewall [ 'dedicatedFirewallFlag' ] ] for vlan in dedicated_firewa... | List firewalls . |
234,353 | def cli ( env , identifier ) : mgr = SoftLayer . NetworkManager ( env . client ) subnet_id = helpers . resolve_id ( mgr . resolve_subnet_ids , identifier , name = 'subnet' ) if not ( env . skip_confirmations or formatting . no_going_back ( subnet_id ) ) : raise exceptions . CLIAbort ( 'Aborted' ) mgr . cancel_subnet ( ... | Cancel a subnet . |
234,354 | def get_settings_from_client ( client ) : settings = { 'username' : '' , 'api_key' : '' , 'timeout' : '' , 'endpoint_url' : '' , } try : settings [ 'username' ] = client . auth . username settings [ 'api_key' ] = client . auth . api_key except AttributeError : pass transport = _resolve_transport ( client . transport ) ... | Pull out settings from a SoftLayer . BaseClient instance . |
234,355 | def config_table ( settings ) : table = formatting . KeyValueTable ( [ 'name' , 'value' ] ) table . align [ 'name' ] = 'r' table . align [ 'value' ] = 'l' table . add_row ( [ 'Username' , settings [ 'username' ] or 'not set' ] ) table . add_row ( [ 'API Key' , settings [ 'api_key' ] or 'not set' ] ) table . add_row ( [... | Returns a config table . |
234,356 | def cli ( env , name , backend_router_id , flavor , instances , test = False ) : manager = CapacityManager ( env . client ) result = manager . create ( name = name , backend_router_id = backend_router_id , flavor = flavor , instances = instances , test = test ) if test : table = formatting . Table ( [ 'Name' , 'Value' ... | Create a Reserved Capacity instance . |
234,357 | def cli ( env , account_id ) : manager = SoftLayer . CDNManager ( env . client ) origins = manager . get_origins ( account_id ) table = formatting . Table ( [ 'id' , 'media_type' , 'cname' , 'origin_url' ] ) for origin in origins : table . add_row ( [ origin [ 'id' ] , origin [ 'mediaType' ] , origin . get ( 'cname' , ... | List origin pull mappings . |
234,358 | def cli ( env ) : manager = PlacementManager ( env . client ) routers = manager . get_routers ( ) env . fout ( get_router_table ( routers ) ) rules = manager . get_all_rules ( ) env . fout ( get_rule_table ( rules ) ) | List options for creating a placement group . |
234,359 | def get_router_table ( routers ) : table = formatting . Table ( [ 'Datacenter' , 'Hostname' , 'Backend Router Id' ] , "Available Routers" ) for router in routers : datacenter = router [ 'topLevelLocation' ] [ 'longName' ] table . add_row ( [ datacenter , router [ 'hostname' ] , router [ 'id' ] ] ) return table | Formats output from _get_routers and returns a table . |
234,360 | def get_rule_table ( rules ) : table = formatting . Table ( [ 'Id' , 'KeyName' ] , "Rules" ) for rule in rules : table . add_row ( [ rule [ 'id' ] , rule [ 'keyName' ] ] ) return table | Formats output from get_all_rules and returns a table . |
234,361 | def _cli_helper_dedicated_host ( env , result , table ) : dedicated_host_id = utils . lookup ( result , 'dedicatedHost' , 'id' ) if dedicated_host_id : table . add_row ( [ 'dedicated_host_id' , dedicated_host_id ] ) try : dedicated_host = env . client . call ( 'Virtual_DedicatedHost' , 'getObject' , id = dedicated_host... | Get details on dedicated host for a virtual server . |
234,362 | def cli ( env , identifier , wait ) : vsi = SoftLayer . VSManager ( env . client ) vs_id = helpers . resolve_id ( vsi . resolve_ids , identifier , 'VS' ) ready = vsi . wait_for_ready ( vs_id , wait ) if ready : env . fout ( "READY" ) else : raise exceptions . CLIAbort ( "Instance %s not ready" % vs_id ) | Check if a virtual server is ready . |
234,363 | def cli ( env , volume_id , replicant_id , immediate ) : block_storage_manager = SoftLayer . BlockStorageManager ( env . client ) success = block_storage_manager . failover_to_replicant ( volume_id , replicant_id , immediate ) if success : click . echo ( "Failover to replicant is now in progress." ) else : click . echo... | Failover a block volume to the given replicant volume . |
234,364 | def cli ( env , identifier ) : mgr = SoftLayer . DedicatedHostManager ( env . client ) host_id = helpers . resolve_id ( mgr . resolve_ids , identifier , 'dedicated host' ) if not ( env . skip_confirmations or formatting . no_going_back ( host_id ) ) : raise exceptions . CLIAbort ( 'Aborted' ) mgr . cancel_host ( host_i... | Cancel a dedicated host server immediately |
234,365 | def get_image ( self , image_id , ** kwargs ) : if 'mask' not in kwargs : kwargs [ 'mask' ] = IMAGE_MASK return self . vgbdtg . getObject ( id = image_id , ** kwargs ) | Get details about an image . |
234,366 | def list_private_images ( self , guid = None , name = None , ** kwargs ) : if 'mask' not in kwargs : kwargs [ 'mask' ] = IMAGE_MASK _filter = utils . NestedDict ( kwargs . get ( 'filter' ) or { } ) if name : _filter [ 'privateBlockDeviceTemplateGroups' ] [ 'name' ] = ( utils . query_filter ( name ) ) if guid : _filter ... | List all private images . |
234,367 | def list_public_images ( self , guid = None , name = None , ** kwargs ) : if 'mask' not in kwargs : kwargs [ 'mask' ] = IMAGE_MASK _filter = utils . NestedDict ( kwargs . get ( 'filter' ) or { } ) if name : _filter [ 'name' ] = utils . query_filter ( name ) if guid : _filter [ 'globalIdentifier' ] = utils . query_filte... | List all public images . |
234,368 | def _get_ids_from_name_public ( self , name ) : results = self . list_public_images ( name = name ) return [ result [ 'id' ] for result in results ] | Get public images which match the given name . |
234,369 | def _get_ids_from_name_private ( self , name ) : results = self . list_private_images ( name = name ) return [ result [ 'id' ] for result in results ] | Get private images which match the given name . |
234,370 | def edit ( self , image_id , name = None , note = None , tag = None ) : obj = { } if name : obj [ 'name' ] = name if note : obj [ 'note' ] = note if obj : self . vgbdtg . editObject ( obj , id = image_id ) if tag : self . vgbdtg . setTags ( str ( tag ) , id = image_id ) return bool ( name or note or tag ) | Edit image related details . |
234,371 | def import_image_from_uri ( self , name , uri , os_code = None , note = None , ibm_api_key = None , root_key_crn = None , wrapped_dek = None , cloud_init = False , byol = False , is_encrypted = False ) : if 'cos://' in uri : return self . vgbdtg . createFromIcos ( { 'name' : name , 'note' : note , 'operatingSystemRefer... | Import a new image from object storage . |
234,372 | def export_image_to_uri ( self , image_id , uri , ibm_api_key = None ) : if 'cos://' in uri : return self . vgbdtg . copyToIcos ( { 'uri' : uri , 'ibmApiKey' : ibm_api_key } , id = image_id ) else : return self . vgbdtg . copyToExternalSource ( { 'uri' : uri } , id = image_id ) | Export image into the given object storage |
234,373 | def cli ( env , identifier , credential_id ) : mgr = SoftLayer . ObjectStorageManager ( env . client ) credential = mgr . delete_credential ( identifier , credential_id = credential_id ) env . fout ( credential ) | Delete the credential of an Object Storage Account . |
234,374 | def list ( self ) : mask = results = self . client . call ( 'Account' , 'getReservedCapacityGroups' , mask = mask ) return results | List Reserved Capacities |
234,375 | def get_object ( self , identifier , mask = None ) : if mask is None : mask = "mask[instances[billingItem[item[keyName],category], guest], backendRouter[datacenter]]" result = self . client . call ( self . rcg_service , 'getObject' , id = identifier , mask = mask ) return result | Get a Reserved Capacity Group |
234,376 | def get_create_options ( self ) : mask = "mask[attributes,prices[pricingLocationGroup]]" results = self . ordering_manager . list_items ( self . capacity_package , mask = mask ) return results | List available reserved capacity plans |
234,377 | def get_available_routers ( self , dc = None ) : mask = "mask[locations]" package = self . ordering_manager . get_package_by_key ( self . capacity_package , mask = "id" ) regions = self . client . call ( 'Product_Package' , 'getRegions' , id = package [ 'id' ] , mask = mask , iter = True ) _filter = None routers = { } ... | Pulls down all backendRouterIds that are available |
234,378 | def create ( self , name , backend_router_id , flavor , instances , test = False ) : args = ( self . capacity_package , 0 , [ flavor ] ) extras = { "backendRouterId" : backend_router_id , "name" : name } kwargs = { 'extras' : extras , 'quantity' : instances , 'complex_type' : 'SoftLayer_Container_Product_Order_Virtual_... | Orders a Virtual_ReservedCapacityGroup |
234,379 | def create_guest ( self , capacity_id , test , guest_object ) : vs_manager = VSManager ( self . client ) mask = "mask[instances[id, billingItem[id, item[id,keyName]]], backendRouter[id, datacenter[name]]]" capacity = self . get_object ( capacity_id , mask = mask ) try : capacity_flavor = capacity [ 'instances' ] [ 0 ] ... | Turns an empty Reserve Capacity into a real Virtual Guest |
234,380 | def cli ( env ) : manager = CapacityManager ( env . client ) result = manager . list ( ) table = formatting . Table ( [ "ID" , "Name" , "Capacity" , "Flavor" , "Location" , "Created" ] , title = "Reserved Capacity" ) for r_c in result : occupied_string = "#" * int ( r_c . get ( 'occupiedInstanceCount' , 0 ) ) available... | List Reserved Capacity groups . |
234,381 | def cli ( env , package_keyname , location , preset , name , send_email , complex_type , extras , order_items ) : manager = ordering . OrderingManager ( env . client ) if extras : try : extras = json . loads ( extras ) except ValueError as err : raise exceptions . CLIAbort ( "There was an error when parsing the --extra... | Place a quote . |
234,382 | def cli ( env ) : table = formatting . Table ( [ 'Id' , 'Name' , 'Created' , 'Expiration' , 'Status' , 'Package Name' , 'Package Id' ] ) table . align [ 'Name' ] = 'l' table . align [ 'Package Name' ] = 'r' table . align [ 'Package Id' ] = 'l' manager = ordering . OrderingManager ( env . client ) items = manager . get_... | List all active quotes on an account |
234,383 | def cli ( env , identifier ) : image_mgr = SoftLayer . ImageManager ( env . client ) image_id = helpers . resolve_id ( image_mgr . resolve_ids , identifier , 'image' ) image_mgr . delete_image ( image_id ) | Delete an image . |
234,384 | def cli ( env , identifier , enabled , port , weight , healthcheck_type , ip_address ) : mgr = SoftLayer . LoadBalancerManager ( env . client ) loadbal_id , group_id = loadbal . parse_id ( identifier ) ip_address_id = None if ip_address : ip_service = env . client [ 'Network_Subnet_IpAddress' ] ip_record = ip_service .... | Adds a new load balancer service . |
234,385 | def cli ( ctx , env ) : env = copy . deepcopy ( env ) env . load_modules_from_python ( routes . ALL_ROUTES ) env . aliases . update ( routes . ALL_ALIASES ) env . vars [ 'global_args' ] = ctx . parent . params env . vars [ 'is_shell' ] = True env . vars [ 'last_exit_code' ] = 0 app_path = click . get_app_dir ( 'softlay... | Enters a shell for slcli . |
234,386 | def get_env_args ( env ) : for arg , val in env . vars . get ( 'global_args' , { } ) . items ( ) : if val is True : yield '--%s' % arg elif isinstance ( val , int ) : for _ in range ( val ) : yield '--%s' % arg elif val is None : continue else : yield '--%s=%s' % ( arg , val ) | Yield options to inject into the slcli command from the environment . |
234,387 | def cli ( env , identifier , purge ) : manager = PlacementManager ( env . client ) group_id = helpers . resolve_id ( manager . resolve_ids , identifier , 'placement_group' ) if purge : placement_group = manager . get_object ( group_id ) guest_list = ', ' . join ( [ guest [ 'fullyQualifiedDomainName' ] for guest in plac... | Delete a placement group . |
234,388 | def cli ( env , context_id , translation_id , static_ip , remote_ip , note ) : manager = SoftLayer . IPSECManager ( env . client ) succeeded = manager . update_translation ( context_id , translation_id , static_ip = static_ip , remote_ip = remote_ip , notes = note ) if succeeded : env . out ( 'Updated translation #{}' ... | Update an address translation for an IPSEC tunnel context . |
234,389 | def cli ( ctx , env ) : env . out ( "Welcome to the SoftLayer shell." ) env . out ( "" ) formatter = formatting . HelpFormatter ( ) commands = [ ] shell_commands = [ ] for name in cli_core . cli . list_commands ( ctx ) : command = cli_core . cli . get_command ( ctx , name ) if command . short_help is None : command . s... | Print shell help text . |
234,390 | def cli ( env , identifier , postinstall , key ) : hardware = SoftLayer . HardwareManager ( env . client ) hardware_id = helpers . resolve_id ( hardware . resolve_ids , identifier , 'hardware' ) key_list = [ ] if key : for single_key in key : resolver = SoftLayer . SshKeyManager ( env . client ) . resolve_ids key_id = ... | Reload operating system on a server . |
234,391 | def cli ( env , identifier , enabled , port , weight , healthcheck_type , ip_address ) : mgr = SoftLayer . LoadBalancerManager ( env . client ) loadbal_id , service_id = loadbal . parse_id ( identifier ) if ( ( not any ( [ ip_address , weight , port , healthcheck_type ] ) ) and enabled is None ) : raise exceptions . CL... | Edit the properties of a service group . |
234,392 | def cli ( env , sortby , datacenter , identifier , subnet_type , network_space , ipv4 , ipv6 ) : mgr = SoftLayer . NetworkManager ( env . client ) table = formatting . Table ( [ 'id' , 'identifier' , 'type' , 'network_space' , 'datacenter' , 'vlan_id' , 'IPs' , 'hardware' , 'vs' , ] ) table . sortby = sortby version = ... | List subnets . |
234,393 | def cli ( env , target , firewall_type , high_availability ) : mgr = SoftLayer . FirewallManager ( env . client ) if not env . skip_confirmations : if firewall_type == 'vlan' : pkg = mgr . get_dedicated_package ( ha_enabled = high_availability ) elif firewall_type == 'vs' : pkg = mgr . get_standard_package ( target , i... | Create new firewall . |
234,394 | def cli ( env , account_id , content_url ) : manager = SoftLayer . CDNManager ( env . client ) content_list = manager . purge_content ( account_id , content_url ) table = formatting . Table ( [ 'url' , 'status' ] ) for content in content_list : table . add_row ( [ content [ 'url' ] , content [ 'statusCode' ] ] ) env . ... | Purge cached files from all edge nodes . |
234,395 | def cli ( env , package_keyname ) : manager = ordering . OrderingManager ( env . client ) table = formatting . Table ( COLUMNS ) locations = manager . package_locations ( package_keyname ) for region in locations : for datacenter in region [ 'locations' ] : table . add_row ( [ datacenter [ 'location' ] [ 'id' ] , datac... | List Datacenters a package can be ordered in . |
234,396 | def cli ( env , abuse , address1 , address2 , city , company , country , firstname , lastname , postal , public , state ) : mgr = SoftLayer . NetworkManager ( env . client ) update = { 'abuse_email' : abuse , 'address1' : address1 , 'address2' : address2 , 'company_name' : company , 'city' : city , 'country' : country ... | Edit the RWhois data on the account . |
234,397 | def cli ( env , quote , ** args ) : table = formatting . Table ( [ 'Id' , 'Name' , 'Created' , 'Expiration' , 'Status' ] ) create_args = _parse_create_args ( env . client , args ) manager = ordering . OrderingManager ( env . client ) quote_details = manager . get_quote_details ( quote ) package = quote_details [ 'order... | View and Order a quote |
234,398 | def authorize_host_to_volume ( self , volume_id , hardware_ids = None , virtual_guest_ids = None , ip_address_ids = None , ** kwargs ) : host_templates = [ ] storage_utils . populate_host_templates ( host_templates , hardware_ids , virtual_guest_ids , ip_address_ids , None ) return self . client . call ( 'Network_Stora... | Authorizes hosts to Block Storage Volumes |
234,399 | def order_replicant_volume ( self , volume_id , snapshot_schedule , location , tier = None , os_type = None ) : block_mask = 'billingItem[activeChildren,hourlyFlag],' 'storageTierLevel,osType,staasVersion,' 'hasEncryptionAtRest,snapshotCapacityGb,schedules,' 'intervalSchedule,hourlySchedule,dailySchedule,' 'weeklySched... | Places an order for a replicant block volume . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.