I control the softlayer resources(Server, Storage etc) by JAVA API.
I am verifying an upgrade to the Evault storage space ( 20GB => 40GB) via the API but the API returns an error message
"error": "EVault service already exists for the requested location (Seoul 1).",
"code": "SoftLayer_Exception_Public"
from the POST event
URL(POST) https://IBMxxxx:xxxxx#api.softlayer.com/rest/v3/SoftLayer_Product_Order/verifyOrder.json
Here is the attached request body
{"parameters":
[
{"complexType":"SoftLayer_Container_Product_Order"
,"orderContainers":[
{"complexType":"SoftLayer_Container_Product_Order_Network_Storage_Backup_Evault_Vault"
,"location":"1555995"
,"packageId":0
,"quantity":1
,"virtualGuests":[
{"complexType":"SoftLayer_Virtual_Guest"
,"id":376047
}
],
"useHourlyPricing":false
,"prices":[
{"complexType":"SoftLayer_Product_Item_Price","id":66257}
]
}
]
}
]
}
What you are doing with that request is ordering an eVault storage, besides the itemId set is for a 60GB EVault Disk capacity and not 40 Gb.
UPDATE
Retrieve item prices only for eVault storage capacities.
https://IBMxxxx:xxxxx#api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/0/getItemPrices?objectMask=mask[id,locationGroupId,item[id,keyName,description],pricingLocationGroup[locations[id,name,longName]]]&objectFilter={"itemPrices":{"item": {"keyName":{"operation":"*=EVAULT"}}}}
Currently to perform an upgrade what you require is to use the method SoftLayer::upgradeVolumeCapacity, please see following request:
Perform capacity upgrade to an specific eVault storage:
(url POST) https://IBMxxxx:xxxxx#api.softlayer.com/rest/v3/SoftLayer_Network_Storage/eVaultId/upgradeVolumeCapacity
with the following request BODY:
{
"parameters":
[
559
]
}
Do not forget to change eVaultId on the request for your eVault storage, try this rest request to retrieve the specific eVault id:
Retrieve an account's associated EVault storage volumes:
https://IBMxxxx:xxxxx#api.softlayer.com/rest/v3/SoftLayer_Account/getEvaultNetworkStorage?objectMask=mask[id, serviceResourceName,guestId,billingItem[id,location]]
Once obtained, then you may specify an upgradeItem (e.g. "itemId": 559 that might be the itemId for 40 Gb evault disk).
To retrieve the upgrade itemId's for the different upgrade capacities allowed, use the following request:
https://IBMxxxx:xxxxx#api.softlayer.com/rest/v3/SoftLayer_Network_Storage/eVaultId/getObject?objectMask=mask[id, billingItem[id, upgradeItems[prices]]]
(don't forget to change the eVaultId).
Review the upgradeItems property and choose the capacity required, you should use the id value for the capacity you need on the method upgradeVolumeCapacity.
For more information about eVaults, see below:
Sample code to handle the upgrade of EVault?
How to find location of an EVault using SoftLayer API?
Sample code for ordering an EVault backup in SoftLayer
Related
I am trying to estimate the cost in Google cloud using cost billing API.In order to test the API with proper output am using POSTMAN and passing JSON representation inside the body.Was able to get the json representation for cloud storage and compute workload but unable to understand for cloud CDN, can anyone help me out?
https://cloud.google.com/billing/docs/reference/cost-estimation/rest/v1beta/CostScenario#cloudcdnworkload
`{
"cacheLookUpRate": {
object (Usage)
},
"cacheFillOriginService": enum (CacheFillOriginService),
"cacheFillRegions": {
object (CacheFillRegions)
},
"cacheFillRate": {
object (Usage)
}
---
}`
I am looking out for proper representation in JSOn so that I can pass it in POSTMAN and get the estimate for CLOUD CDN workload just like that I have got for compute.
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:
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_InvalidValue): Invalid value provided for 'blockDevices'. Block devices may not be provided when using an image template.
Using slcli is failing as well with a different error:
# slcli vs create --hostname testvsi --domain vmonic.local --flavor BL2_4X8X100 --image 1cc8be72-f230-4ab9-b4b2-329c3e747853 --datacenter tok02 --private
This action will incur charges on your account. Continue? [y/N]: y
SoftLayerAPIError(SoftLayer_Exception_Public): Order is missing the following category: Operating System.
Please advice whether using "image_id" with "flavor" is supported in SL API / python API. Thanks!
this 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:
POST: https://$USERNAME:#APIKEY#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/createObject
Payload:
{
"parameters": [{
"datacenter": {
"name": "tok02"
},
"domain": "softlayer.local",
"hourlyBillingFlag": true,
"blockDeviceTemplateGroup": {
"globalIdentifier": "1cc8be72-f230-4ab9-b4b2-329c3e747853"
},
"hostname": "rcabflav",
"privateNetworkOnlyFlag": true,
"supplementalCreateObjectOptions": {
"flavorKeyName": "BL2_4X8X100"
}
}]
}
and you will get the same error, I reported this error in Softlayer, if you want you can submit a ticket in softlayer and report it as well.
I'm taking my first experimental steps with google-pre-setup templates in a Google Cloud Template (Cloud Pub/Sub to BigQuery).
As a milestone to my final goal (having physical gadgets reporting a data stream to Google Cloud Pub/Bub), my wish is to achieve something like this:
POSTMAN (make authenticated POST request with JSON message to an Google Cloud Platform, GPC, endpoint) --> GPC Pub/Sub --> GPC DataFlow --> GPC BigQuery.
Right now I am following the tutorial found in Executing Templates, https://cloud.google.com/dataflow/docs/templates/executing-templates, "Example 2: Custom template, streaming job". This section states:
...This example projects.templates.launch request creates a streaming job
from a template that reads from a Pub/Sub topic and writes to a
BigQuery table. The BigQuery table must already exist with the
appropriate schema. If successful, the response body contains an
instance of LaunchTemplateResponse. ...
and further more how to do a POST:
https://dataflow.googleapis.com/v1b3/projects/[YOUR_PROJECT_ID]/templates:launch?gcsPath=gs://[YOUR_BUCKET_NAME]/templates/TemplateName
{
"jobName": "[JOB_NAME]",
"parameters": {
"topic": "projects/[YOUR_PROJECT_ID]/topics/[YOUR_TOPIC_NAME]",
"table": "[YOUR_PROJECT_ID]:[YOUR_DATASET].[YOUR_TABLE_NAME]"
},
"environment": {
"tempLocation": "gs://[YOUR_BUCKET_NAME]/temp",
"zone": "us-central1-f"
}
}
There are two things that confuses me. Let's for the sake of a simple example say that I have multiple vehicles who continuously should report their current status. I have already created my MQTT topic: VEHICLE_STATUS. Each och my vehicles should be able to report its:
Position [String]
Speed [Float]
Time [String]
VehicleID [Integer]
=======
I'm aware of the prototype for a PubsubMessage:
{
"data": string,
"attributes": {
string: string,
...
},
"messageId": string,
"publishTime": string,
}
My questions:
How should my BigQuery table schema look (which columns do I need to create)?
How should the entire corresponding JSON message look? What should my vehicle report to the endpoint each time?
We are building a implementation where we can delete all the block sotrage including performance & endurance with selected billing ID, I have used the following softlayer rest api for cancellation of storage for our implementation
"https://api.softlayer.com//SoftLayer_Billing_Item/billingID/cancelItem"
Softlayer team told that if i will like to have my services removed immediately, i will need to update the request accordingly with my intention. So, what is the extra parameter should i give in that mentioned api to cancel the request immediately.
Regards,
Debartha
Please try the following request:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Billing_Item/[billingItemID]/cancelItem
Method: POST
Json Payload:
{
"parameters": [
true,
false,
"No longer needed",
"Cancel immediately"
]
}
The first property as true will cancel the item immediately. Please see the SLDN reference SoftLayer_Billing_Item::cancelItem
To get the billingItemID, please execute:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[StorageID]/getBillingItem
Method: GET
How can I get connection information of clusters in softlayer? I need public and private authentication urls for all clusters.
It seems that softlayer doesn't support the /v1/endpoints api of open stack api.
And I can see the getObjectStorageConnectionInformation api in Network Storage.. But don't know how to use it.
Try to use the following method:
SoftLayer_Network_Storage::getObjectStorageConnectionInformation, it will display the information of clusters and their endpoints (public and private)
To use this method, you need to provide an Object Storage's identifier, you can retrieve these identifiers (Object Storage identifiers), with the following REST request:
https://$username:$apiKey#api.softlayer.com/rest/v3/SoftLayer_Account/getHubNetworkStorage
Method: Get
Note: Replace $username and $apiKey with your own information.
You will retrieve a result like this:
{
"accountId": 123456
"capacityGb": 5000
"createDate": "2015-01-20T16:21:02-04:00"
"guestId": null
"hardwareId": null
"hostId": null
"id": 41111111
"nasType": "HUB"
"password": ""
"serviceProviderId": 1
"storageTypeId": "15"
"upgradableFlag": true
"username": "SLOS123456-10"
...
Then, you can get object storage connection with the following Rest request (Use the "id" value from the previous request)
https://$username:$apiKey#api.softlayer.com/rest/v3/SoftLayer_Network_Storage/41111111/getObjectStorageConnectionInformation
Method: Get
Note: Replace $username, $apiKey and 41111111 value with your own information
Some important references:
Managing SoftLayer Object Storage Through REST
APIs
An Introduction to Object
Storage
I'm using Advanced REST client for Chrome