SoftLayer Curl Command Does Not Match UI Output - api

I've been creating and deleting VMs, and trying to pull their status throughout the processing of the order.
The output is always '{"id":[ID],"statusId":1001}' no matter where in the process the order is.
In the UI, it may say 'Attaching Primary Disk', but it will always output 'Active' and '1001' using the API.
The command used:
curl https://[username]:[apiKey]#api.softlayer.com/rest/v3/Softlayer_Hardware_Server/[serverID].json
Is there a reason why this doesn't work? Is there a solution to getting the status using the API?

About the status you see in UI "Attaching Primary Disk", I think you are talking about the transaction status, to retrieve that information you can use the following methods
For Virtual Guests:
https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getActiveTransaction
https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getActiveTransactions
https://softlayer.github.io/reference/services/SoftLayer_Virtual_Guest/getLastTransaction
For Hardware Servers:
https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getActiveTransaction
https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getActiveTransactions
https://softlayer.github.io/reference/services/SoftLayer_Hardware_Server/getLastTransaction

When you create a new VM the status will be ¨Active¨ and statusId= 1001 , it means it is in use, when you cancel a VM the status will be ¨Disconnected¨ and statusId= 1006 before to be canceled completely.
After that the status is ¨RESOURCE RESERVE¨ before removing the VM, in this status the VM is not longer listed for users whether through the api o UI.
For more reference you can see the following link:
SoftLayer Virtual Guest host Status list
Try with below curl command to retrieve the VM status:
curl -k "https://[username]:[apiKey]#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/[vmId]/getObject.json" | python -mjson.tool
Or you can use the following rest api:
Method: GET
https://[username]:[apiKey]#api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/[vmId]/getObject?objectMask=mask[status]

Related

Checkout as guest with shopware 6 store-api

I am using the shopware 6 store-api and attempting to convert a cart to an order as a guest. Beforehand, I register the guest using the account/register endpoint with the guest: true parameter.
However, when I try to convert the cart to an order with checkout/order, I receive the error CHECKOUT__CUSTOMER_NOT_LOGGED_IN. I understand that this is because I am a guest, but I cannot login because this requires a password. Is there a way to fix this issue and convert the cart to an order as a guest?
As response from the register-api-call you get a new sw-context-token returned as a header.
You need to use this token from there on for all following api-requests, as it contains all customer related context.

s4sdk openSAP develop extension Course - Address not created - no put operation in mock server log

I have created mock server and it shows GET operation selecting all partners and will get a partner by id.
If I click on the Add address button there is no put or post operation in the log file.
Mock server log:
Request: GET
/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner(BusinessPartner='1003764')?$select=BusinessPartner,CreationDate,FirstName,IsFemale,IsMale,LastName,to_BusinessPartnerAddress/AddressID,to_BusinessPartnerAddress/BusinessPartner,to_BusinessPartnerAddress/CityName,to_BusinessPartnerAddress/Country,to_BusinessPartnerAddress/HouseNumber,to_BusinessPartnerAddress/PostalCode,to_BusinessPartnerAddress/StreetName&$expand=to_BusinessPartnerAddress&$format=json
Reading business partner 1003764
Log from application
12:51:35.357 [http-bio-8080-exec-10] ERROR
com.sap.cloud.sdk.odatav2.connectivity.ODataQuery - Successfully
connected to destination service.
Am I missing a setting?
You can implement an add functionality for a Business Partner Address in the following way:
BusinessPartnerAddress addressToCreate = BusinessPartnerAddress.builder()
.businessPartner(businessPartnerId)
.streetName("someStreet")
.build();
new DefaultBusinessPartnerService()
.createBusinessPartnerAddress(addressToCreate)
.execute();

SoftLayer blockstorage status

I am trying to retrieve SoftLayer Block storages.
I am using the following URL:
https://api.softlayer.com/rest/v3.1/SoftLayer_Account.json?objectMask=mask[iscsiNetworkStorage.volumeStatus]
from which I recieve JSON-data.
What I want to know is, if the ISCSI Storage status is "ACTIVE" or something similar.
Here is the JSON-data which is received:
"capacityGb":20
"volumeStatus":"PROVISION_COMPLETED"
"volumeStatus":{"createDate":"2016-02-02T00:49:19-06:00","message":"Volume Provisioning has completed.","scheduleId":null,"typeId":314,"volumeId":8904469}}
How do I get to know the status?
The property used to know the status of a Network storage volume is volumeStatus , please see: SoftLayer_Network_Storage datatypes.
It seems when ‘volumeStatus’ value is null, the item is “inactive”, otherwise if it has a value (“Volume Provisioning has completed.”), the item is "active".
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Account/getIscsiNetworkStorage?objectMask=mask[username,volumeStatus]
Method: GET
References:
SoftLayer_Account::getIscsiNetworkStorage

SoftLayer API: - How to get the ID of a bare metal server on create

I'm using 'SoftLayer_Hardware', 'createObject' to deploy new servers, however this call returns no id, as on the example on http://sldn.softlayer.com/reference/services/SoftLayer_Hardware/createObject
So if I have no id how can I query info for that server? I noticed there's a globalIdentifier variable but no mention at all on what it is and how to use it
you can use the goblal identifier instead the ID in your request
e.g.
Get https://api.softlayer.com/rest/v3.1/SoftLayer_Hardware/$GloblalIdentifier/getObject
Note: replace the $GloblalIdentifier
The reason why the id is not displayed is because the server was not created yet, your order has to be approved and when the provisioning is ended the id will show up, meanwhile you can use the global identifier when the provisioning ends you will be able to see the id
regards
Here SoftLayer_Hardware::createObject says:
To determine when the server is available you can poll the server via
SoftLayer_Hardware::getObject,
checking the provisionDate property. When provisionDate is not null,
the server will be ready. Be sure to use the globalIdentifier as your
initialization parameter.
Please see this example:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Hardware/[globalIdentifier_value]/getObject
Method: GET
Also, you can get Bare Metal information using SoftLayer_Account::getHardware with some filters:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectFilter={"hardware":{"hostname":{"operation": "myhostname"}, "domain":{"operation": "mydomain"}}}&objectMask=mask[id,fullyQualifiedDomainName,provisionDate]
Method: GET
Note: You can add some masks in order to get more information than by default, i.e. In the previous request you can see the provisionDate(When provisionDate is not null, the server will be ready).
List Bare metal servers filtering by username who created them:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectFilter={ "hardware": { "billingItem": { "orderItem": { "order": { "userRecord": { "username": { "operation": "myusername" } } } } } } }&objectMask=mask[id,fullyQualifiedDomainName,billingItem.orderItem.order.userRecord.username,provisionDate]
Method: GET
Also you can review:
Softlayer API to get virtual guest owner
thank you for your answers. Unfortunately this is a chicken/egg problem. Once the API call is sent, I get an GloblalIdentifier but not an id.
If I ask for this GloblalIdentifier I get a response with id as null
If I get the listing of the hardware servers, I see the new machine is there, has an id, but the GloblalIdentifier is None.
Makes no sense.

Command Status 0x00000011 with submit_multi for SMPP integration

Hi am integrating with Sybase Mobile 365 Services and I have gotten submit_sm and deliver_sm to work fine. I am trying to get submit_multi to work, but no matter what I try I get back a Command Status = 11. Does anyone have any thoughts as to what that command status means? Why I would get that? I have tried different service types and everything else I can think of... with no success.
Thanks,
Stephen
Command Status = 11 (ESME_RINVDSTADR) means "Invalid destination address".
This mean that probably the the dest_address field in your submit_multi request is wrong.
The dest_address field for submit_multi should be a list of destination address structures as defined in SMPP 3.4 Specification - chapter 4.5.1.1.
The number of destination addresses in the list is set in the number_of_dests field.
Additionally, you could also check that the dest_addr_ton (Type of Number) and dest_addr_npi (Numbering Plan Indicator) are correct for each destination address. For more details about this check out this link.