softlayer-python | A set of Python libraries that assist in calling the SoftLayer API
kandi X-RAY | softlayer-python Summary
kandi X-RAY | softlayer-python Summary
A set of Python libraries that assist in calling the SoftLayer API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Prepares a replicant volume object
- Returns the tier IOPS per unit
- Retrieve metadata attribute
- Find the price for a given tier level
- Returns the options required to create a dedicated location group
- Calculates the cost of a given item
- Return the price for a given item
- Calculates the cost for a given preset
- Display options for an order
- Helper to output the diagnostic information
- Prints the reponseable
- Edit an instance
- Edit a hardware
- Authenticate using the IAM API
- List interfaces in a security group
- Get results for a given ticket
- Update the arguments for a virtual machine
- List dedicated hosts
- Prepares a volume order object
- Edit a CDN instance
- Returns the creation options for the given datacenter
- Prepares an order object
- Prepares an order object for a snapshot space
- Upgrade an instance
- Get information about a file volume
- Prepares a duplicate order object
softlayer-python Key Features
softlayer-python Examples and Code Snippets
df['computer_name'].str.replace(r'\S{3}(\S+?)(?:\.\S+|$)', r'xxx\1')
0 LENOVO 09 xxxH0GB
1 LENOVO xxxsbpmh613
2 Dell Inc. PowerEdge R910 xxx2S75
3 HP xxxsfe
import SoftLayer
API_USERNAME = 'set me'
API_KEY = 'set me'
client = SoftLayer.create_client_from_env(username=API_USERNAME, api_key=API_KEY)
billingItemId = 1234
mask = "mask[location]"
try:
response = client['SoftLayer_Billing_I
endpoint = 's3-api.us-geo.objectstorage.softlayer.net'
endpoint = 'https://s3-api.us-geo.objectstorage.softlayer.net'
e.g:
env['Network_Gateway_Vlan'].deleteObject(id=theIdofTheObject)
res = env['Network_Gateway_Vlan'].createObject(obj)
env['Network_Gateway_Vlan'].deleteObject(id=res["id"])
from __future__ import print_function
import SoftLayer
from SoftLayer.managers.vs import VSManager
def create_vsi():
#Create a client to the SoftLayer_Account API service.
#Note: currently set without the user ID and API key since
mgr = ImageManager(client)
resp = mgr.get_image(image_id=1211529)
import SoftLayer
from SoftLayer import VSManager
from pprint import pprint as pp
USERNAME = 'set me'
API_KEY = 'set me'
options = {
'cpus': 4,
clientService.getObject(id=myInitParameter)
$client = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$accountInfo = $client->getObject();
$hardware = $client->getH
objectFilter={"itemPrices":{"locationGroupId":{"operation":"is null"}}}
https://[userName]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/46/getItemPrices?objectFilter={"itemPrices":{"locationGroupId"
accountId = 202768 #change this value
mask = "mask[accountId, certificateSigningRequest, certificateAuthorityName, id]"
response = client['SoftLayer_Security_Certificate_Request'].getSslCertificateRequests(accountId)
# Declare an Object Mask to get additional information
object_mask = 'mask[primaryRouter,subnets[id,billingItem,cidr,version,addressSpace,subnetType,networkIdentifier,totalIpAddresses,usableIpAddressCount,ipAddresses[id, ipAddress, virtual
Community Discussions
Trending Discussions on softlayer-python
QUESTION
When I used slcli(softlayer-python command) to create a dedicated host, the command return the order id. And I check the order's status was 'APPROVED'. But I can not get the host in the result of 'SoftLayer_Account/getDedicatedHosts'.
So I check the billing item and it is 'dedicated_virtual_hosts' rightly. Did SoftLayer API support another approach to inspect the dedicated host provisioned? Or did I do something wrong?
...ANSWER
Answered 2018-Feb-01 at 15:26Yes, the dedicated host should be listed when calling to SoftLayer_Account::getDedicatedHosts method, or when using the "slcli dedicatedhost list" command. I suggest to check your permissions and device access, verify that "View Virtual Dedicated Host Details" is checked.
Below are some slcli commands I executed to order and list dedicated hosts.
To order a dedicated host:
QUESTION
We want to programatically order VSI using the flavor (for example. Balanced type), however instead of using the standard os_code, we want the VSI to be created from a public image template (ie. CentOS7-ChangeStable). From the following doc it seems to be possible.
http://softlayer-python.readthedocs.io/en/latest/_modules/SoftLayer/managers/vs.html
However I tried but got the following error:
...ANSWER
Answered 2017-Oct-30 at 16:56this is an issue with the API, the python client uses the http://sldn.softlayer.com/reference/services/softlayer_virtual_guest/createObject method to create the VSI using RESTFul the same request would be something like this:
QUESTION
I use Python API to create vsi and got an issue when I tried to create a vsi from an existing image template. My Python version is 3.6.3 and I run my Python scripts on Windows 7.
Your documentation (http://softlayer-python.readthedocs.io/en/latest/api/managers/vs.html) says:
os_code (string) – The operating system to use. Cannot be specified if image_id is specified.
image_id (int) – The ID of the image to load onto the server. Cannot be specified if os_code is specified.
When I specify image_id without os_code in my python script, I got the following error:
...ANSWER
Answered 2017-Oct-23 at 20:20For your reference, below is the python script that I use to actually create a vsi or just try a dry run:
QUESTION
Wandering how to do it in java. Example in other language would be helpful too. Looked at api docs and java-client docs. Somewhat helpful was this, but that does not show how what is required content of data: http://softlayer-python.readthedocs.io/en/latest/_modules/SoftLayer/managers/dns.html#DNSManager.create_record.
...ANSWER
Answered 2017-Jan-12 at 08:17There seems to be a php example https://gist.github.com/softlayer/815278 Maybe it's possible to do something similar with java client.
QUESTION
Couldn't find any example or documentation. Looking at python cli tool: http://softlayer-python.readthedocs.io/en/latest/_modules/SoftLayer/managers/network.html#NetworkManager.cancel_subnet
It seems like I have to delete billing item matching the subnet id?
...ANSWER
Answered 2017-Jan-05 at 12:50That's rigth practically all the Softlayer Services have a billing Item , if you want to cancel the service you need to cancel the billing Item.
The subnet services provides a method to retrieve the associated billig item http://sldn.softlayer.com/reference/services/SoftLayer_Network_Subnet/getBillingItem
once you have the billing item you can proceed to cancel it using> http://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/cancelService
ig you need an example in Java let me know, but practically if you call those methods above using Java you shouldn't have any problem to cancel the item.
Regards
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install softlayer-python
You can use softlayer-python like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page