VRA 6.2 REST API: CatalogItemRequest - number of machines?

I started looking in the REST API vRA for 6.2 and can't seem to properly configure a machine using the CatalogRequestItem type.  However, I can only ask a machine at a time.  Is there a setting (or the value of the property) that can be added to the query to specify the number of machines to ask?  Or is there a different API call to do this?  Thank you.

Take a loot at the next post. Add this to your JSON blob (where the value is the number of instances that you want to deploy).

  {
    "key": "supplier - Cafe.Shim.VirtualMachine.NumberOfInstances."
    'value': {}
      "type': 'integer."
      'value': 2
    }
  }

Grant

Tags: VMware

Similar Questions

  • VRA 6.2 REST API: resource Action with object mapped by VRO

    I created a resource Action (Advanced Services - resources Actions) who calls a workflow orchestrator (VRO) to do a few things.  The VRO workflow takes three objects as inputs: 2 channel and a VC:VirtualMachine.  Connecting the web GUI, when a user selects the action for the specific virtual machine, they are presented with a form asking to specify the content of the 2 strings.  The VC:VirtualMachine object is transparant and (I think) is automatically mapped internally to the enabled virtual machine.  This works very well at the launch through the web GUI.  Now, I need to create the same scenario using the REST API.  I created the "ResourceActionRequest" object JSON and included the 2 strings as indicated in the request data, but I have no idea how to do to add the VC:VirtualMachine object to the request.  I thought maybe it was too transparent, but I get an error if I try to send the JSON without the 3rd data item.  For example, here is my "ResourceActionRequest" object JSON:

    {

    "@type": "ResourceActionRequest",

    'resourceRef': {}

    'id': '< resourceRef-id >.

    },

    'resourceActionRef': {}

    'id': '< resourceActionRef-id >.

    },

    'Organization': {}

    "tenantRef': '< label >."

    "tenantLabel': '< label >."

    'subtenantRef': '< subtenantRef > ',.

    'subtenantLabel': '< subtenantLabel > '.

    },

    "State": "SUBJECT."

    "requestNumber": 0.

    'requestData': {}

    "items": [{}

    "key": "provider-MyFirstCustomProperty."

    'value': {}

    "type": "string",.

    "value': ' blah, blah, blah."

    }

    },

    {

    "key": "provider-MySecondCustomProperty."

    'value': {}

    "type": "string",.

    "value': ' blah, blah, blah."

    }

    }]

    }

    }

    I don't know how to provide the VC:VirtualMachine in the application.  Any help would be appreciated.  Thank you!

    -Stephen

    Hey Stephen,

    I do not see the bits that I expect:

    {

    "key": "provider-MachineName."

    'value': {}

    "type": "string",.

    'value': 'vra045 '.

    }

    }

    It's vRA identity Machine which must correspond to the rear.

    Grant

  • REST API - the field value date Contact exported in digital format.

    Hi people,

    I used below REST API to retrieve the Contacts with the views and custom filter.

    The JSON response, I shot the date value in the number format. As 'C_Lead_Score_Date': '1434456862',


    https://secure.Eloqua.com/API/rest/1.0/data/contact/view/ {identifier} / contacts/filter / {id}


    How can I convert the appropriate number in date value? or y at - it an adjustment to the level of the code to retrieve the value in the correct date format.


    The data type of the field is dates.

    The date is returned to as a Unix timestamp.

    You can use an online converter to convert it to a normal value, for example: online - time conversion Conversion Unix

    1434456862 = Tuesday, June 16, 2015 12:14:22 GMT

  • Get the emails in descending order of creation date. [REST API]

    Hello I am trying to GET emaiils of the REST API in order descending creation date. So far, my URL params look like:

    emails/assets /? Search = * BN * & page = 1 & number = 50 & depth minimum = & orderBy = converted

    This seems to put in ascending order. I wonder if I can specify the order? I noticed for the contacts there is a sorting = {sortOn} & dir = desc, so is it possible

    to do with e-mails? I tried to join the above URL & dir = desc but not luck and assuming that he only is not supported from this page http://topliners.eloqua.com/docs/DOC-3083.

    Yes I can reverse my logic in the program from the end of emails received, but I wonder if I can simply specify order emails using the REST API?

    Please let me know and thank you.

    Hi John,.

    To sort by a column name, such as the 'name' field, you can simply add the following query string parameters: & orderBy = name % 20desc

    The sort directions are: asc | / / DESC

    We will share a post soon to describe how to do this. The API should support the "dir" query string argument, but it doesn't seem to work. We will look into it as well.

    Hope this helps,

    Fred

  • Sorting of emails [REST API] [PHP]

    Hello, I am trying to sort emails by using URL parameters. I am trying to sort the messages by date of creation, or in any case that would have the most recently created e-mail first and in descending order.

    So far, I have https://secure.eloqua.com/API/REST/1.0/assets/emails?search= * SNL * & page = 1 & number = 50 & depth minimum = & spell = converted & dir = desc

    The & sort = converted & dir = desc settings seem to do absolutely nothing.

    I think that converted is a timestamp because updatedAt resembling a timestamp as well, but this is perhaps the place where it was created. Maybe even sorting by ID would be a good thing because

    I think that id autoincrements. So more the ID, the most recent of the email, but this assumption may fail in some cases. I tried & sort = id & dir = desc and which does not change the order as well.

    So what are the properties can I sort through emails? Any ideas on how to sort to have emails more recently created first and in descending order?

    I also use an instance of E9.

    Hi John,.

    You can use the following query parameters when you search Emails using the REST API:

    • GET/assets/emails? depth = {depth} & count = {number} & page = {page} & search = {search} & orderBy = {orderBy} & lastUpdatedAt = {lastUpdatedAt}

    The document following (to access emails using the REST API) described the available properties on the object of the contract. To retrieve the most recent, you can order in "updatedAt.

    I hope this helps.

    Thank you

    Fred

  • REST API: attribute converted

    I use the REST API to access emails, and I found that the converted attribute is not readable in a time string. Could someone tell me how to convert it into a time warp?
    An example is converted":"1410076908 ". How to convert this number strng in one hour?

    The time stamp is provided in the format of the time.  Please see this page for info on this format of time stamp: http://www.epochconverter.com

  • info point endpoint gettting with REST API vRA7

    Retrieving information of endpoint using vRealize Automation REST API (2145780). VMware KB

    Is this KB including vRA7?

    These are always created in IaaS in vRA 7.0, so are not accessible through the public API.

  • REST API assignRolePermissionToUserGroup

    Im trying to update the objects of our clients have right of in vROps, programmatically through the REST API. The idea is that when a customer starts rotating or destroyed a virtual computer through vRA, we would find all of their machines virtual provisioned and rebuild the list of objects for their group of vROps through vRO using the REST API of vROps. I have a vRO workflow that looks like this:

    var groupId = "8c380090-d5c3-42a7-a77c-5de4437ce85b"
    var resourceId = "8e62002f-0965-47e2-a82a-6d403b44b756"
    
    var body = {"traversal-spec-instances" : [{
      "traversal-spec-instance" : {
           "selectAllResources" : false,
           "name" : "vSphere Hosts and Clusters",
           "resourceKind" : "vSphere World",
           "adapterKind" : "VMWARE",
           "resourceSelection" : [{
                "resourceId" : [
                     resourceId,
                     "4abb32e5-1fd0-443b-85ed-4995da4a1a0d"
                ],
                "type" : "SPECIFIC"
           }]
      }
    }],
    "allowAllObjects" : false,
    "roleName" : "ReadOnly"
    }
    System.log(JSON.stringify(body));
    
    
    var request = restHost.createRequest("PUT", "/auth/usergroups/" + groupId + "/permissions", body);
    request.contentType = "application/json";
    
    
    var json = JSON.stringify(System.getModule("com.vmware.library.http-rest").xml2json(request.execute().contentAsString));
    System.log(json);
    
    
    

    Which produces the string JSON:

    {"traversal-spec-instances":[{"traversal-spec-instance":{"selectAllResources":false,"name":"vSphere Hosts and Clusters","resourceKind":"vSphere World","adapterKind":"VMWARE","resourceSelection":[{"resourceId":["8e62002f-0965-47e2-a82a-6d403b44b756","4abb32e5-1fd0-443b-85ed-4995da4a1a0d"],"type":"SPECIFIC"}]}}],"allowAllObjects":false,"roleName":"ReadOnly"}
    
    
    

    There are no examples of the request body then I'm just doing what I interpret requires that the documentation of the REST API.

    Run this generates the error:

    {"error":{"message":"Invalid input format.","xmlns:ops":"http://webservice.vmware.com/vRealizeOpsMgr/1.0/","moreInformation":{"info":{"content":"/suite-api/api/auth/usergroups/8c380090-d5c3-42a7-a77c-5de4437ce85b/permissions","name":"api-uri"}},"httpStatusCode":400,"xmlns:xs":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","apiErrorCode":400}}
    
    
    

    Which is not very useful.

    I checked with other API calls that the groupId is correct and returns a grump object valid through the REST API. So my assumption at this point is that the body of the request is malformed but I'm not sure how and errors are not giving me much to go.

    You're right about the resourceKind.  I did some tests and the JSON body below worked for me.  I changed two things:

    1. I converted the body to a string variable.  It seemed that it was sent as an object.
    2. I removed the "path-spec-instance", while the instance is just placed between braces inside the "crossing-spec-proceedings".  I did a get on a sample group and that's how it was formatted.
    var body = {"traversal-spec-instances" : [{  
    
           "selectAllResources" : false,
           "name" : "vSphere Hosts and Clusters",
           "resourceKind" : "vSphere World",
           "adapterKind" : "VMWARE",
           "resourceSelection" : [{
                "resourceId" : [
                     resourceId,
                     "414f5fdc-a651-4886-adb7-5d947c69ae63"
                ],
                "type" : "SPECIFIC"
           }]  
    
    }],
    "allowAllObjects" : false,
    "roleName" : "ReadOnly"
    }
    System.log(JSON.stringify(body));
    System.log(typeof body);
    var stringBody = JSON.stringify(body);  
    
    var request = restHost.createRequest("PUT", "/auth/usergroups/" + groupId + "/permissions", stringBody);
    request.contentType = "application/json";
    
  • Vcac rest api group

    Hello

    I try to GET to https://VRA_URL:8443/darwin/api/2.0/group but I get no answer.

    Added headers:

    1 content-Type: application/json

    2 permission: carrier < token >

    Am I missing something?

    Darwin's App Services?  I am familiar with this... but I know how to get a business group IaaS through the REST API of vRA if that is what you want.

  • REST API: Assets in Flex updated

    We are trying to update some of the attributes in the assets of Flex using the REST api.

    However when we post the update of the application, Server CS began mandatory reporting are not provided.

    Question: Do we need to DISPLAY all the attributes that are required, even if we just want to update a field?

    Do we need to retrieve all of the required fields first and post them agin? What is the best way to update one of the attributes?

    We are running on 11.1.1.6.1

    [2014-05-14 15:19:50, 447 EDT] [DEBUG] [o - 169.113.108.89 - 7211-exec-626] [com.fatwire.rest.time] complete POST on: http://host/CS/rest/sites/xxx/types/xxxxxx/assets/1320477860438; Of the query parameters: {ticket = [ST-1278-B1c9OpwQvtgk16AqkcZy-number-1]}; Time: 32 m

    [2014-05-14 15:19:50, 447 EDT] [DEBUG] [o 169.113.108.89 - 7211-exec-626] [fatwire.rest.resources.BaseExceptionMapper] attribute AttributeName is required for AssetType XXXXXXX and cannot be null

    com.fatwire.rest.ServiceException: attribute ATTRIBUTE_NAME is mandatory for AssetType XXXXXX and cannot be null

    at com.fatwire.rest.service.impl.LocalAssetService.updateAsset(LocalAssetService.java:505)

    at com.fatwire.rest.service.impl.LocalAssetService.updateAsset(LocalAssetService.java:466)

    at com.fatwire.rest.resources.SiteTypeAssetResource.updateAsset(SiteTypeAssetResource.java:134)

    at sun.reflect.GeneratedMethodAccessor545.invoke (unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:606)

    to com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ ResponseOutInvoker._dispatch (AbstractResourceMethodDispatchProvider.java:175)

    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)

    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:208)

    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:75)

    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:115)

    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:67)

    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:775)

    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:740)

    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:731)

    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:372)

    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:452)

    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:633)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at com.fatwire.auth.RequestAuthenticationFilter.doFilter(RequestAuthenticationFilter.java:192)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at com.fatwire.wem.sso.cas.filter.CASFilter.doFilter(CASFilter.java:602)

    at com.fatwire.wem.sso.SSOFilter.doFilter(SSOFilter.java:51)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:205)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

    at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:193)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)

    to org.apache.coyote.AbstractProtocol$ AbstractConnectionHandler.process (AbstractProtocol.java:589)

    to org.apache.tomcat.util.net.JIoEndpoint$ SocketProcessor.run (JIoEndpoint.java:312)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:615)

    at java.lang.Thread.run(Thread.java:744)

    Caused by: com.fatwire.assetapi.common.AssetAccessException: attribute AttributeName is required for AssetType XXXXXX and cannot be null

    at com.fatwire.assetapi.data.FlexAssetDataWriteStrategy._populateAttributes(FlexAssetDataWriteStrategy.java:207)

    at com.fatwire.assetapi.data.FlexAssetDataWriteStrategy.getInstance(FlexAssetDataWriteStrategy.java:56)

    at com.fatwire.assetapi.data.BasicAssetDataWriteStrategy.getInstances(BasicAssetDataWriteStrategy.java:334)

    at com.fatwire.assetapi.data.FlexAssetDataWriteStrategy.write(FlexAssetDataWriteStrategy.java:44)

    at com.fatwire.assetapi.data.AssetDataManagerImpl.update(AssetDataManagerImpl.java:255)

    at com.fatwire.assetapi.data.AssetDataManagerImpl.update(AssetDataManagerImpl.java:233)

    at com.fatwire.rest.service.impl.LocalAssetService.updateAsset(LocalAssetService.java:501)

    ... more than 41

    Hi Sarath.Dontireddy,

    Even if you just want to update a field, you must collect all and post them later. Otherwise, those that you do not fill will be empty and updated, with the impact on the required fields as the can not be null, so that you get the trace of the error as the attribute a name.

    Kind regards

    Enrique

  • vCO 5.5.2 and vCAC 6.1 plugin error REST API

    Hello

    I get an error when you try to make applicants vCAC 6.1 REST API calls of vCO 5.5.2 for the items in the catalog.  This same code works very well with the vCAC 6.0.1 plugin.

    Error:

    Data serialization error. (Workflow: Test vCAC remains / Scriptable task (item1) #24)

    Code:

    var point = {'@type': 'CatalogItemRequest',}

    "catalogItemRef": {"id": "3e6c3f13-6ea0-4da5-8bac-d8cb27e64f24"},

    "Organization": {"tenantRef": "vcacadmin"}

    {"subtenantRef": "e931debb-6200-40e5-89a7-01d35d0cc306"},

    "requestedFor": "[email protected]",

    "State": "SUBJECT."

    "requestNumber": 0.

    "requestData": {"items": []}

    {"key": "provider-blueprintId', 'value': {'type': 'string', 'value':"catalogItem.id"}}.

    {"key": "provider-provisioningGroupId', 'value': {'type':"string","value":"e931debb-6200-40e5-89a7-01d35d0cc306"}},

    {"key": "requestedFor', 'value': {'type':"string","value":"[email protected]"}},

    {'key': 'provider - VirtualMachine.CPU.Count', 'value': {'type': 'integer', 'value': 1}},

    {'key': 'provider - VirtualMachine.Memory.Size', 'value': {'type': 'integer', 'value': 1024}},

    {'key': 'provider - VirtualMachine.LeaseDays', 'value': {'type': 'integer', 'value': 0}},

    {"key": "provider-__Notes', 'value': {'type': 'string', 'value': 'Test'}},

    {'key': 'provider - VirtualMachine.Disk0.Size', 'value': {'type': 'string', 'value': '40'}},

    {{[{"key": 'provider - VirtualMachine.Disk1.Size', 'value': {'type': 'string', 'value': '8'}}]}}

    var catalogRest = vcac.createRestClient (vCACCAFEServicesEnum.CATALOG_SERVICE);

    var answer = catalogRest.post("consumer/requests",item);

    vCAC 6.0.x plugin expects a json object in the call to rest.

    6.1 plugin expects a value of json string.

    This will do the trick:

    var response = catalogRest.post ("consumer/queries", JSON.stringify (item));

  • vShield does REST APIs support JSON?

    Hello

    I tried on vShield REST API. Support the JSON content type? All of the examples I see is using xml. I am able to get JSON content. But when I try to create/update it gives me the error.

    This gives me the answer in JSON format:

    curl k u < user >: < pass > h ' Accept: application / json ' https:// /API/2.0/services/ipset/ipset-150 < ip >

    But if I try:

    curl k u < user >: < pass > x POST h "Accept: application / json ' h ' Content-Type: application / json" d "{'description': 'test FPS',"name":" FPS-test-1', 'value': '22.22.22.1', 'revision': 0 '} " https:// /api/2.0/services/ipset/dvportgroup-1265 < ip >

    I get the following error:

    The HTTP 400 - the request sent by the client state is syntactically incorrect.

    Please help me with this.

    Kind regards

    Skander

    I think that our RESTful systems only manage the entry of XML format.  This is more of a general statement that specific POSSIBLE.

    You can file a request for assistance for a feature request?  Some people asking about it internally as a possible use scenarios to see what the benefits would be there.  If you make an SR, private Message me please the SR number.

  • C#, UCCX, Rest API, PUT (update a resource) and not taken media Type supported

    Hi, I'm developing an application to update the skills of resources with the REST API.

    I can get all the values I want to (GET), but when I try to update a resource using PUT, and then I get a "415 Unsupported Media Type" webException.

    I discovered that c# / UCCX works with demand. MediaType (instead of request. ContentType).

    I got this error when I tried to GET the data. He now works for the GET.

    But to PUT it, I got the error. Method is defined as SAID, MediaType = "application/xml".

    I tried to empty, ' text/xml '...

    Looked on the internet, Web sites, saying always specify ContentType/MediaType = "application/xml", I have already done.

    I also got the same error if I try an application COULD and without sending data.

    Thanks for your help!

    public string MakeRequest()
    {
    var request = (HttpWebRequest) WebRequest.Create (EndPoint);
    request. Credentials = new System.Net.NetworkCredential (login, password);
    request. Method = Method.ToString ();
    request. ContentLength = 0;
    request. Accept = ContentType;
    request. MediaType = ContentType;
                
    #region so PUT
    If (! string.) IsNullOrEmpty (PostData) & method == HttpVerb.PUT)
    {
    encoding of var = new UTF8Encoding();
    PostData = PostData.Replace ("\n", "");
    var bytes = Encoding.UTF8.GetBytes (PostData);
    request. ContentLength = bytes. Length;
                    
    using (var writeStream = request. GetRequestStream())
    {
    writeStream.Write (bytes, 0, bytes.) (Length);
    }
    }
    #endregion

    Try
    {
    assistance (response var = (HttpWebResponse) request. GetResponse())
    {
    var responseValue = string. Empty;

    If (answer. StatusCode! = HttpStatusCode.OK)
    {
    var message = String.Format ("request failed. Received HTTP {0}", response. StatusCode);
    throw new ApplicationException (message);
    }

    Enter the answer
    using (var responseStream = response. GetResponseStream())
    {
    If (responseStream! = null)
    using (var = new StreamReader (responseStream) Player)
    {
    responseValue = reader. ReadToEnd();
    }
    }

    Return responseValue;
    }
    }
    catch (WebException wex)
    {
    error string = wex. Message;
    Return ' ';
    }

    OK you got, in this case, post your request in the Sub forum as well which is sought after by developers and you can you expect a concrete answer/explanation on the same

    https://communities.Cisco.com/community/Developer/Express-configuration-API

    Concerning

    Deepak

  • CPO 3.0 call a REST API

    I try to call a remote REST API that returns a JSON object.

    The call browser API looks like this

    http://IPAM-dev/phpipam/API/?app_id=API&controller=sections&action=read&ID=6

    Returns

    {'success': true, 'data': {'id': '6', 'name': "Telford subnets", 'description': '',' masterSection': '0', 'permissions': "{\"4\":\"1\ ""} strictMode ',' ': '1', 'subnetOrdering': null, 'order': null, "editDate": null, "showVLAN": '0', 'showVRF': '0' "}}

    When I try to use the OPC Web HTTP Request activity it fails with the following error

    Unable to send a content-body with this type of verb.

    I think the problem here is the content type. The default is application/xml; charset = utf - 8 in the activity, I tried to change this text, html and json, but still did not work. I can't let the emty content type in the activity.

    Anyone have any suggestion how to make a REST of CPO call using the activity Web HTTP request

    Try to change GET to POST (in the form of CALL-CPO_REST - RQ.png).  Sends the contents of the body generally requires a POST not a GET.

  • Expose REST APIs on the API Oracle Gateway

    Hi all

    Can someone help me to OAG. I'm new on this.

    I want to expose some REST API of gateway API as well as Oracle are accessible on mobile phones and browsers.

    An example or a document for this help

    Thank you

    Laetitia

    What version of Oracle application Gateway you use, if you use of the OAG version 11.1.2.4.0 then you need to install the hotfix.

    Please see this document on the oracle support: Doc ID 2070998.1

    Kind regards

    Anshul

Maybe you are looking for