SoftLayer blockstorage status - api

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

Related

Ebay MIP upload *.csv error "Item.Country missing"

currently I am trying to upload articles to ebay with https://developer.ebay.com/products/mip but getting a result file back where for each article the error appears:
No <Item.Country> exists or <Item.Country> is specified as an empty tag in the request.
Every required field shown here https://developer.ebay.com/devzone/merchant-products/mipng/user-guide-en/default.html#definitions-combined-feed.html?TocPath=Inventory%2520management%257CFeed%2520definitions%257C_____5 is present and also the "Localized For" field.
Does someone have a clue what I miss to make it work?
This is the problematic CSV:
SKU,Return Policy,Payment Policy,Shipping Policy,Category,Channel ID,Fulfillment Type,List Price,Location ID,Picture URL 1,Condition,EAN,Product Description,Title,Localized For,Total Ship to Home Quantity,VATPercent,Best Offer Enabled,BO Auto Accept Price,BO Auto Decline Price,Country
1011689,Return Policy - Test Text,Payment Policy - Test Text,Shipping Policy - TestText,,EBAY_DE,SHIP_TO_HOME,10,75172 Pforzheim,https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/EBay_logo.svg/1000px-EBay_logo.svg.png,NEW,4008153740657,Really long description,Title of article,de_DE,10,19,true,10,5,DE
and this the response csv:
SKU, Group ID, Locale, Channel ID, Item ID, Status, Message Type, Message ID, Message
1011689,,de_DE,EBAY_DE,,FAILED,ERROR,10009,No <Item.Country> exists or <Item.Country> is specified as an empty tag in the request.
The Problem was that on the Merchant Platform Frontend no Store Location was set.
Also policies have to be created before.

Bloomberg API - How to get user entitlements for user subscription

i'm just trying to check user entitlements for user subscription data from bloomberg api's data feeds.
For this i tried to run Bloombergs example "EntitlementsVerificationSubscriptionExample". As it seems to be working at first sight, on second sight i recognized, that there aren't any entitlements for the data i receive from the api.
that means:
public void processSubscriptionDataEvent(Event eventObj, Session session)
{
foreach(Message msg in eventObj)
{
bool needsEntitlement = msg.HasElement(Name.GetName("EID"));
}
}
is always 'false', as there is never a field called "EID" available.
Is there something wrong on bloomberg service site or better, is there any kind of documentation available, how to use user entitlements within data subscriptions?
thanks in advance,
First, you need to subscribe to the "EID" field, as it's not returned by default.
If the field either is not returned in the message, or had Null value, then that means data in this message does not require entitlements. Otherwise, call the following function and pass the EID value:
bool bEntitled = userIdentity.hasEntitlements(EID);
Function return value indicates whether user is entitled or not.
Data that does not require entitlements can be shared with users who are registered in EMRS (in case of B-Pipe), or with any terminal user within the firm (in case of SAPI) with no further entitlement check. Users who are not registered in EMRS or those who are non-terminal users should not have access to either B-Pipe data, or SAPI data, respectively.

How do I call getDuration in mediaBrowserService from an Activity?

Earlier, using boundService this could be easily achieved. But with MediaBrowserService I can't access getDuration outside, without which I am unable to update the seekbar.
On the MediaBrowserService, when you're updating the MediaMetadata, add the duration of the current media.
MediaMetadataCompat.Builder metadataBuilder = new MediaMetadataCompat.Builder();
metadataBuilder.putLong(MediaMetadataCompat.METADATA_KEY_DURATION, track.durationMs);
While on the client side, using MediaBrowserCompat you're able to connect to you MediaBrowserService and retrieve a MediaSessionCompat.Token. With the token you can then get a MediaSessionController from where you can get the MediaMetadataCompat that has information about the current media.
int duration = (int) metadata.getLong(MediaMetadataCompat.METADATA_KEY_DURATION);
The official documentation has an ok explanation on how this works a whole

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.

Always getting 0 rules when querying products/(id)/rules/count and 204 status from /rules

I'm contacting the API of my client's store on BigCommerce. I've verified the option set has a bunch of rules associated with it (8 product rules).
When I contact the api with
/api/v2/products/181/rules I get a 204 response.
This seems to be an incorrect response.
I tried then contacting
/api/v2/products/181/rules/count
and I get a response of:
{ count:0 }
How do I get a proper representation of these rules, as the API specification describes?
Thanks for any help you can provide. I'm stuck.
The response indicates that there are no rules associated with the product ID in your request. Are you sure that the option set you're referring to has been assigned to the product ID referenced in your request? It is possible that the option set has rules but the product does not have an option set assigned to it.