Body section rest API request

Hello

I use this code to create a rest api to request my server rest api

varPr = Host.createRequest("POST", "/track/all", null).execute();

but I want to set some parameters of body to my application how can I do?

The 3rd parameter of the createRequest() method is the body of the request (null in your example).

Don't know which body your/track/all REST API, but here's a code example illustrating how to pass a string value when a workflow starts with a parameter of type string:

var content = {
  "parameters": [
  {
    "type": "string",
    "scope": "local",
    "name": "param",
    "value": {
      "string": {
        "value": "some sample string value"
      }
    }
  }
  ]
}

var body = JSON.stringify(content);
var request = host.createRequest("POST", "/workflows/76312d50-3dda-4f09-a6d7-322c652b10a4/executions", body);  // vCO REST API to start a workflow given its ID
request.contentType = "application/json";
var response = req.execute();

System.log("response status -> " + response.statusCode);

Tags: VMware

Similar Questions

  • Calling REST API security token error simple GET method

    Please help me get past this error. I have yet to get a successful REST API request of Eloqua. API is enabled for our sandbox that I managed by instantiating different SOAP request/response.

    This is my test RequestURI

    https://secure.Eloqua.com/API/rest/2.0/data/contact/3

    With the method 'GET' headers appropriate and what I have collected of their API guides, including the very useful

    Eloqua REST API - authentication

    Eloqua REST API - URL parameters

    Eloqua REST API - HTTP request headers

    RequestURI works when typed manually into a authenticated (connected to the Eloqua Sandbox session) tab of the FireFox browser.

    When I try the request in my tools (middleware Tibco integration, acting as a client HTTP request), I always get the answer:

    A security token that is associated with your session became invalid.

    I saw this topic, but this was not useful in my case.

    http://topliners.Eloqua.com/message/20371#20371

    The behavior in my case is pretty consistent, and seems not to care if I even spoil RequestURI making it invalid. The same error persists.

    Help, please! Thank you

    Heath

    A more complete answer follows:

    < RequestActivityOutput >

    < header > HTTP/1.1 200 OK

    Content-Type: text/html; charset = utf-8

    Content-Length: 2355

    Date: Friday, April 19, 2013 19:43:19 GMT

    cache-control: private

    connection: close

    P3P: CP = "IDC DSP COR DEVa TAIa OUR PHY ONL UNI COM NAV CNT STA BUS."

    < / header >

    < statusLine >

    < httpVersion > HTTP/1.1 < / httpVersion >

    < statusCode 200 > < / statusCode >

    < reasonPhrase > OK < / reasonPhrase >

    < / statusLine >

    ....

    A security token that is associated with your session became invalid.

    This can happen if you open multiple instances of Eloqua, in

    different browser Windows or tabs, then the diary of one of

    These instances.  Please either close this window or tab, or

    & lt; a href = "" / FormsLogin.aspx "target ="_top"> click here to connect to new & lt;" /a >. & lt; br >

    Heath,

    I'm not able to simply navigate to this URL in my browser either, even though I am connected to my sandbox (which has access to the API). I don't know how you manage to get there in Firefox.

    That being said, I can hit this page of the REST API very well when I base64 encode my credentials HTTP as described here:

    Eloqua REST API - authentication

    May be useful to take a look at the auth string you use when calling from rest.

    Jim

  • 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.

  • Add a contact e-mail group via the Rest API

    Hello

    Is it possible to add a contact to a group of e-mail through the Rest API?

    I saw this article here http://topliners.eloqua.com/docs/DOC-3526 which shows that you can get a subscription email group contacts status, however it is not clear how actually to add a contact to a group of e-mail via the API.

    I tried to post data to ' data/contact / {id} / groups/email/subscription "but I get a response of"Method not allowed"API."

    If someone managed to achieve? If so, how?

    See you soon

    Hi David,

    The POST operation is not supported by this endpoint, but you can use PUT a method for updating subscriptions Contact:

    • PUT: / data/contact / {id} / email/group / {groupId} / subscription

    Where the request body contains an object of the subscription. Hope this helps and please let us know if you need more information.

    Thank you

    Fred

  • Using the REST API to delete the contact from the contacts list

    Hello world

    I am looking for some info for the creation of a request to delete a contact from a list of Contact using the REST API.   Here's what I have in Java where the contact id is 1 'and my list is 72'.     I'm open to responses in Java, c# or other languages.

    serverAddress = new URL ("https://secure.p03.eloqua.com/API/REST/1.0/assets/contact/list/72");

    establish communication stuff

    connection = null;

    Set up the initial connection

    connection = (HttpURLConnection) serverAddress.openConnection ();

    connection.setRequestMethod ("PUT");

    connection.setRequestProperty ("content-type", "json; charset=utf-8 ");"

    connection.setRequestProperty ("authorization", 'Basic BLOCKED');

    String body = '{\"membershipDeletions\":[\"1\']}";

    connection.setDoOutput (true);

    connection.getOutputStream () .write (body.getBytes ("UTF8"));

    connection.setReadTimeout (10000);

    Connection.Connect ();

    When I test with it I get a '400' HTTP response

    Thank you!

    Hi Noel,

    The following document describes the operations available for lists of contacts in the Rest API. Please note that we also have a project open source c# example illustrates the use of these endpoints.

    Repositories are all available to the public on Github. Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • REST API - POST: / data/Objetpersonnalise / {id}

    Is there a specific documentation describes to the REST API - data object customPOST call?


    I tried a few different ways to call it without success, some of which are described below.


    This is the custom, object that I work with:

    Table

    (

    [type] = > Objetpersonnalise

    [id] = > 19

    [depth] = > full

    [description] = > custom Description of object

    [name] = > custom Elomentary Test object

    [fields] = > Array

    (

    [0] = > array

    (

    [type] = > CustomObjectField

    [id] = > 131

    [depth] = > full

    [name] = > testing a ground

    [type] = > text

    [displayType] = > text

    [internalName] = > Test_field_one1

    )

    [1] = > array

    (

    [type] = > CustomObjectField

    [id] = > 132

    [depth] = > full

    [name] = > two field Test

    [type] = > text

    [displayType] = > text

    [internalName] = > Test_field_two1

    )

    )

    )

    I tried a few different methods to make this request, but I'll try to refrain from posting a wall of the code, and I'll put everything that I think is most close to being correct based on some examples to

    Looking at the test customObjectData-helper to, eloqua-samples/customObjectData-helper/CustomObjectDataTests to fredsakr/eloqua-samples of master · GitHub

    Request URL: https://secure.p03.eloqua.com/api/rest/2.0/data/customObject/19

    The raw request:

    POST /api/rest/2.0/data/customObject/19 HTTP/1.1

    Host: secure.p03.eloqua.com

    User-Agent: Elomentary (http://github.com/tableau-mkt/elomentary)

    Content-Type: application/json

    Content-Length: 90

    {"fieldValues can only be": [{'id': 131, 'value': 'testing123'}, {'id': 132, "value": "alkfjsaldkjfasldjka"}]}

    And the response headers:

    HTTP/1.1 404 not found

    Cache-Control: private

    Content-Length: 1565

    Content-Type: text/html; Charset = UTF-8

    P3P: CP = "" IDC DSP COR DEVa TAIa OUR PHY ONL UNI COM NAV CNT STA BUS ","

    Date: Tuesday, July 29, 2014 14:32:22 GMT

    cannot get property

    The body of the response:

    <? XML version = "1.0" encoding = "utf-8"? >

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < title > < /title > Service

    < style > < / style >

    < / head >

    < body >

    < div id = "content" >

    < class p = "title 1" > Service < /p >

    < p > endpoint could not be found. < /p >

    < / div >

    < / body >

    < / html >

    Parris,

    Endpoint for the creation of object (custom p03) data seems to have been replaced by:

    POST Api/rest/1.0/data/customObject/{customObjectId}

    Endpoint you are trying to use has worked before. I don't know what happened... I found this useful documentation:

    https://secure.P03.Eloqua.com/API/docs/dynamic/rest/1.0/reference.aspx

    Jason Kay

  • Error in creating a category with the REST API

    vRO 7.0.1

    I am trying to create a category in the folder root of Workflow using the REST API.

    URL = https://vroserver.fqdn:8281 / vco/api/categories

    Method = POST

    The API documentation suggests that the body should be like this:

    {

    "categoryType": "WorkflowCategory",

    'name': "Test5",.

    'description': 'Testing '.

    }

    However, I always get a 400 response: the request sent by the client is syntactically incorrect.

    reflecting the docs by: category name must be specified

    Can anyone help?

    Body of the request should be:

    {
       "type":"WorkflowCategory",
       "name":"Test5",
       "description":"Testing"
    }
    
  • Using c# to access the REST API - 404 not found

    Hi all!

    Since there is currently no available c# example to access the REST API, I'm going at this from scratch using the Nuget - Microsoft.AspNet.WebApi.Client package.

    I was able to successfully implement a framework for code that is able to make a call to the base_uris method and successfully receive a response.

    I'm doing a transientDocuments call, but I still get a 404 not found error.  I'm hoping somewhere here may be able to enlighten.  I tried to use the current examples of Java to call REST API to get help on how to go about things.

    I create an instance of the AdobeDCREST class, and pass the BaseUrl (https://api.echosign.com/api/rest/v5/) and my key to integration.  When I make a call to the PostTransientDocuments method I pass into the path of the pdf file that I am trying to download.  PostTransientDocuments then deals with the creation of an object the HttpContent (StreamContent) of the file, and then adding the headers, ContentType and ContentDisposition.  The call to GetClient() will determine whether base_uris should be called still or not (I make the call to base_uris and storage of the api_access_point in a variable static for all other calls, as well as the java examples) and returns an object of the HttpClient with the access in the header already token.  The call to base_uris works and returns a https://api.na1.echosign.com/ api_access_point

    I then add/api/rest/v5 to the url access_point to call transientDocuments. Failure occurs during the call to PostAsync in transientDocuments with a 404 not found error.

    Here's the code I'm using to test things so far.  Any help would be greatly appreciated.  I've been spinning my wheels on that for too long already.

    using System;

    using System.Collections.Generic;

    using System.IO;

    using System.Linq;

    using System.Net.Http;

    using System.Net.Http.Headers;

    using System.Text;

    using System.Threading.Tasks;

    namespace Ivezt.Documents {}

    public class AdobeDCREST {}

    < Summary >

    A static variable that is defined by an initial call to GetBaseURIs() and used for all API calls later.

    < / Summary >

    Private Shared ReadOnly Property SERVICES_BASE_URL as string = string. Empty;

    < Summary >

    The end point of API to use.  This aspect will have to be changed if Adobe is moving to a new version of the API and we update this

    the code to use this new version.

    < / Summary >

    Private Shared ReadOnly Property API_URL as string = "api/rest/v5 /";

    < Summary >

    This BaseUrl is passed to the constructor and used to make a call to GetBaseURIs().

    < / Summary >

    private string m_strBaseUrl = string. Empty;

    < Summary >

    The IntegrationKey is passed to the constructor and must be added to the header of each API request.

    < / Summary >

    private string m_strIntegrationKey = string. Empty;

    public AdobeDCREST (string strBaseUrl, string strIntegrationKey) {}

    m_strBaseUrl = strBaseUrl;

    m_strIntegrationKey = strIntegrationKey;

    }

    private HttpClient GetDefaultClient() {}

    HttpClient client = new HttpClient();

    Add an Accept header for JSON format.

    customer. () DefaultRequestHeaders.Accept.Add

    (new MediaTypeWithQualityHeaderValue("application/json"));

    Add the access token

    customer. DefaultRequestHeaders.Add ("Access token", m_strIntegrationKey);

    customer feedback;

    }

    private HttpClient GetClient() {}

    If we have not yet the SERVICES_BASE_URL, then we must do a GetBaseURIs call

    If (SERVICES_BASE_URL. Length == 0) {}

    HttpClient baseClient = GetDefaultClient();

    Use the BaseUrl passed to the constructor

    baseClient.BaseAddress = new Uri (m_strBaseUrl);

    URI BaseURIs_Response = GetBaseURIs (baseClient);

    SERVICES_BASE_URL = string. Format ("{0} {1}", uris.api_access_point, API_URL);

    baseClient.Dispose ();

    }

    If (SERVICES_BASE_URL. Length == 0)

    throw new Exception ("failed to retrieve Adobe Document cloud Base URI");

    HttpClient client = GetDefaultClient();

    customer. BaseAddress = new Uri (SERVICES_BASE_URL).

    customer feedback;

    }

    public BaseURIs_Response GetBaseURIs(HttpClient client) {}

    Call base_uris

    HttpResponseMessage response = client. GetAsync ("base_uris"). Result;  Call blocking!

    If (answer. IsSuccessStatusCode) {}

    Analyze the response body. Blocking!

    answer back (BaseURIs_Response). Content.ReadAsAsync (typeof (BaseURIs_Response)). Result;

    }

    else {}

    throw new Exception (string. Format ("{0} ({1})", (int) response. ") StatusCode, response. ReasonPhrase));

    }

    }

    public TransientDocument_Response PostTransientDocuments (string strFilePath) {}

    Call transientDocuments

    Content the HttpContent = new StreamContent (new FileStream (strFilePath, FileMode.Open, FileAccess.Read));

    content. Headers.ContentType = new MediaTypeHeaderValue("application/pdf");

    content. Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") {}

    Name = "file."

    FileName = 'Template.pdf.

    };

    HttpClient client = GetClient();

    HttpResponseMessage response = client. PostAsync ("transientDocuments", content). Result;  Call blocking!

    If (answer. IsSuccessStatusCode) {}

    Analyze the response body. Blocking!

    answer back (TransientDocument_Response). Content.ReadAsAsync (typeof (TransientDocument_Respons e)). Result;

    }

    else {}

    throw new Exception (string. Format ("{0} ({1})", (int) response. ") StatusCode, response. ReasonPhrase));

    }

    }

    }

    public class BaseURIs_Response {}

    public string web_access_point {get; set ;}}

    public string api_access_point {get; set ;}}

    }

    public class TransientDocument_Response {}

    public string transientDocumentId {get; set ;}}

    }

    }

    I think I found my problem.  I was not a multi-part post form data.  Once I changed this, everything worked as expected.  Here is an updated version of the PostTransientDocuments() method that works:

    public TransientDocument_Response PostTransientDocuments (string strFilePath) {}

    Call transientDocuments

    using (var = {GetClient() customer)}

    using (var content = new MultipartFormDataContent()) {}

    var multiplesContent = new StreamContent (new FileStream (strFilePath, FileMode.Open, FileAccess.Read));

    fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");

    fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") {}

    Name = "file."

    FileName = 'Template.pdf.

    };

    content. Add (FileContent);

    HttpResponseMessage response = client. PostAsync ("transientDocuments", content). Result;  Call blocking!

    If (answer. IsSuccessStatusCode) {}

    Analyze the response body. Blocking!

    answer back (TransientDocument_Response). Content.ReadAsAsync (typeof (TransientDocument_Respons e)). Result;

    }

    else {}

    throw new Exception (string. Format ("{0} ({1})", (int) response. ") StatusCode, response. ReasonPhrase));

    }

    }

    }

    }

  • Query of REST API resources

    I'm trying to get a resource by name using the/api/resources URI. He has a list of parameters that can be used to perform a more detailed query. I tried just about everything I can think of to get the query to work but nothing is. Does anyone have a work resource query?

    nameArray of names of resources to interview. NOTE: Currently, only single element taken in chargequeryXS: StringNoneYes
    var body = {"name" : "vmName"}
    System.log(JSON.stringify(body));
    var request = restHost.createRequest("GET", "/resources", JSON.stringify(body));
    request.contentType = "application/json";
    
    var json = JSON.stringify(System.getModule("com.vmware.library.http-rest").xml2json(request.execute().contentAsString));
    System.log(json);
    

    I tried all these without success:

    var body = {"name" : "vmName"}
    var body = {"name" :["vmName"]}
    var body = [{"name" : "vmName"}]
    var body = {"value" : {"name" : "vmName"}
    var body = {"value": {"name" : ["vmName"]}
    var body = {"value" : [{"name" : "vmName"}]
    

    variations of the above, but with different top level like, value (s) key (s), resource, property/properties, etc., of property names.

    He hit me after the validation:

    var request = restHost.createRequest("GET", "/resources?name=vmName", null);
    request.contentType = "application/json";
    
    var json = JSON.stringify(System.getModule("com.vmware.library.http-rest").xml2json(request.execute().contentAsString));
    System.log(json);
    

    Which returns my only object.

  • 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";
    
  • QUESTION: Can't create a firewall rule to (edge) with the REST API

    Dear Sir

    I am trying to create a firewall rule for simple and basic edge using the REST API.

    I use the REST API guide as a reference on page 158.


    edge-fw-rule.png

    I use the following code (single) in my client REST API (with good content Type (application/xml)):

    < rule >

    < ruleTag > < / ruleTag >

    < name > edge5-rest-rule < / name >

    all < source > < / source >

    < destination > all < / destination >

    < application > all < / application >

    < matchTranslated > true < / matchTranslated >

    < management > in < / direction >

    < action > deny < / action >

    < enabled > false < / enabled >

    < loggingEnabled > true < / loggingEnabled >

    rest-api-rule of the < description > < / description >

    < / rule >

    The error message that I receive is the following:

    <? XML version = "1.0" encoding = "UTF-8"? >

    < error >

    request details invalid <>. Found no match for item rule. < / details >

    < > 223 errorCode < / errorCode >

    < / error >

    The full screenshot of my action REST API is in the screenshot below:

    full-request.png

    Anyone know what I'm doing wrong here?

    Thank you!

    Try this as the body...

    rest-rule

    user

    true

    in

    deny

    fake

    true

    rest-api-rule

  • Create the edge with the NSX REST API

    Hello

    I am trying to create a new benefit using the REST API, but I get the following error over and over again: the server has refused the request because the request entity is in a format not supported by the resource for the requested method.

    I use using a xml model provided by the nsx_61_api.pdf and all the "ids" settings are ok. Can anyone tell my what of wrong in my XML?

    I'm able to get a list of the existing edges using GET on https:// < nsxmgr-ip > /api/4.0/edges/

    In this case, I use the same URL, but with the post OFFICE instead. In the body, I put the following XML code.

    < edge >
    <datacenterMoid>datacenter-2</datacenterMoid>
        < name > MyName-Edge-01 < / name >
        < holding > Default < / holding >
    <vseLogLevelemergency</vseLogLevel> >
    <devices>
    <applianceSize>compact</applianceSize>
            < appliance >
    <resourcePoolId>resgroup-5050</resourcePoolId>
    <datastoreId>datastore-104</datastoreId>
            < / appliance >
        < / appliances >

        < vnics >
            < vnic >
                < index > 0 < / index >
                < name > uplink01 < / name >
                < type > uplink < / type >
    <portgroupId>virtualwire-10</portgroupId>
    <addressGroups>
                    < addressGroup >
    <primaryAddress>10.0.0.1</primaryAddress>
    <secondaryAddresses>
                            < ipAddress > 10.0.0.2 < / ipAddress >
                            < ipAddress > 10.0.0.3 < / ipAddress >
    <>of theipAddress10.0.0.4</> of theipAddress
    </secondaryAddresses>
    <subnetPrefixLength>29</subnetPrefixLength>
                    < / addressGroup >
                < / addressGroups >
                < MTU > 1600 < / MTU >
    <enableProxyArp>false</enableProxyArp>
    <enableSendRedirects>true</enableSendRedirects>
    <isConnected>true</isConnected>
    <inShapingPolicy>
    <averageBandwidth>20000000</averageBandwidth>
    <peakBandwidth>20000000</peakBandwidth>
    <burstSize>0</burstSize>
                    < enabled > true < / enabled >
                    < inherited > false < / inherited >
    </inShapingPolicy>
    <outShapingPolicy>
    <averageBandwidth>20000000</averageBandwidth>
    <peakBandwidth>20000000</peakBandwidth>
                    < burstSize > 0 < / burstSize >
                    < enabled > true < / enabled >
                    < inherited > false < / inherited >
    </outShapingPolicy>
            < / vnic >
        < / vnics >
    <cliSettings>
    <>theusernameadmin</> user name
    <password># 123456 PasssworD</> password
    <remoteAccess>true</remoteAccess>
        < / cliSettings >
    < / edge >


    Thank you very much

    D.

    Finally, I discovered.

    You must add the header without papers:

    XML:application / xml

    Don't ask me why this non-standard header is not documented.

    D.

  • Workflow of vCO of query using the REST API in PowerShell

    Hello

    I am interrogating a workflow vCO by name using the REST API of PowerShell based on this article:

    http://www.vcoteam.info/articles/learn-VCO/268-how-to-use-the-rest-API-to-start-a-workflow.html

    $username = "XXXXXX".

    $upassword = "XXXXXX".

    $auth = $username + ':' + $upassword

    $Encoded = [System.Text.Encoding]: UTF8. GetBytes ($auth)

    $EncodedPassword = [System.Convert]: ToBase64String ($Encoded)

    $headers = @{' authorization '=' basic $($EncodedPassword) ' ;}}

    $body = "<-xmlns = execution context" ". ' http://www.VMware.com/VCO ' > < / execution context > '

    #query for workflow named "donothing".

    Invoke-RestMethod-uri https://XXXX:8281/api/flow /? conditions = name = donothing -Headers $headers - body $body - ContentType "application/xml" - Get method

    Invoke RestMethod: failed to send a content-body with this type of verb.

    On line: 1 char: 1

    + Call-RestMethod-uri https://XXXX:8281/api/flow /? conditions = name = donoth ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (:)) [invoking-RestMethod], ProtocolViolationException)

    + FullyQualifiedErrorId: System.Net.ProtocolViolationException, Microsoft.PowerShell.Commands.InvokeRestMethodCommand

    The request succeeds by using the customer REMAINS on Firefox, but I can't make it work on PowerShell. (NOTE: PowerShell workflow execution works very well)

    Any help is appreciated.

    Thank you

    Juan.

    OK, I managed to do work by removing

    [System.Net.ServicePointManager]: ServerCertificateValidationCallback = {$true}

    And add this at the beginning of the script

    "Add-type @ '.

    using System.Net;

    using System.Security.Cryptography.X509Certificates;

    public class TrustAllCertsPolicy: {ICertificatePolicy

    public bool CheckValidationResult)

    ServicePoint srvPoint, X509Certificate certificate,

    WebRequest request, int certificateProblem) {}

    Returns true;

    }

    }

    "@

    [System.Net.ServicePointManager]: CertificatePolicy = New-Object TrustAllCertsPolicy

    Now I can use the GET method:

    $ret = Invoke-WebRequest - uri $URL - Headers $headers - ContentType "application/xml" - Get method

    I spent to Invoke-WebRequest so I can get the return of application Web.

    Juan.

  • REST API

    Hello

    Can someone tell me how to move from entry to the POST of the REST API method?

    My goal is to plan a deployment using the REST API with the changed value of the key - "domain_name_distingueshed".

    To plan a deployment by using the POST method with value key changed, I'm providing command as follows:

    curl - i - user admin:ca$ hc0w - d POST request ' < node > < name > AD - D_1.0 < / name > < node components > < name > cmf_ad_config > < / name > < property > < key > domain_name_distinguished < / key > < value > <! [CDATA [test_rest.com]] > < / value > < / property > < / node-components > < / node > ' https://10.99.130.221:8443/darwin/api/1.0/deployment-profile/182/action/deploy - url https://10.99.130.221:8443 / darwin -k

    But I am getting error as follows:

    localhost: / curl # Rest_Op - i - user admin:ca$ hc0w - d POST request ' < node > < name > AD - D_1.0 < / name > < node components > < name > cmf_ad_config > < / name > < property > < key > domain_name_distinguished < / key > < value > <! [CDATA [test_rest.com]] > < / value > < / property > < / node-components > < / node > ' https://10.99.130.221:8443/darwin/api/1.0/deployment-profile/182/action/deploy - url https://10.99.130.221:8443 / darwin -k

    HTTP/1.0 200 connection established

    Media type not supported HTTP/1.1 415

    Server: Apache-Coyote/1.1

    Set-Cookie: JSESSIONID = 008C1EA0E619382E6E08377C4E122205; Path = / darwin /; Guarantee; HttpOnly

    Content-Type: text/html; charset = utf-8

    Content-Length: 1123

    Date: Monday, April 8, 2013 09:18:02 GMT

    < html > < head > < title > VMware vFabric tc DURATION 2.6.5.RELEASE/7.0.26.A.RELEASE - error report < / title > < style > <!-H1 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 22px ;}} H2 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 16px ;}} H3 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76; do-size: 14px ;}} BODY {do-family: Tahoma, Arial, without serif; color: black; background-color: white ;}} B {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76 ;}} P {do-family: Tahoma, Arial, without serif;: white background; color: black; do-size: 12px ;}} A {color: black ;}} B.SID {color: black ;}} HR {color: # 525 76 ;} - > < / style > < / head > < body > < h1 > State HTTP 415 - < / h1 > < HR size = "1" = "noshade" noshade > < p-type > < b > < /b > < /p > < p > < b > report message < /b > < u > < / u > < / p > < p > < b > description < /b > < u > the server refused} This request because the request entity is in a format not supported by the resource for the requested method (). < /u > < /p > < HR size = "1" noshade "noshade" = > < h3 > VMware vFabric tc DURATION 2.6.5.RELEASE/7.0.26.A.RELEASE < / h3 > < body / > < / html > HTTP/1.1 302 moved temporarily

    Server: Apache-Coyote/1.1

    Location: https://10.99.130.221:8443 / darwin /

    Transfer-Encoding: segmented

    Date: Monday, April 8, 2013 09:18:02 GMT

    I just wanted to confirm that I'm using the correct way to make a contribution to the POST method?

    I also tried with the entry of the POST command XML file:

    curl - i - user admin:ca$ hc0w - POST - h file request "Content-Type: text/xml"-d-Binary @dep_prop.xml https://10.99.130.221:8443/darwin/api/1.0/deployment-profile/182/action/deploy - url https://10.99.130.221:8443 / darwin -k

    But it is also in error.

    Am I missing something?

    Thanks in advance!

    Replace the profile-properties-response with the properties of the profile. Let me know if it works.

  • POST CURL with vCO 5.1 REST API

    I am trying to invoke a vco workflow by using the 5.1 REST API through curl. I could do GET without any issue; but POST always gives me the 400 bad request error below. I want to use json instead of xml, so I passed in "Content-Type: application/json". I am using windows curl.

    Initially I tried to create a settings file to json with "-d @filename"; It gives the same error.

    If someone could tell what is wrong with my syntax? Thank you.

    curl-i k - vcoadmin:vcoadmin of the user x POST h ' Content-Type: application / json ' https://192.168.1.7:8281 / api/stream/dec0e608 - 8 b 8
    3 4e32-8825-3e77ef31c4d7/presentation/instances - d '{} '.

    HTTP/1.1 400 Bad Request
    Content-Type: text/html; charset = utf-8

    Content-Length: 965
    Date: Tuesday, March 5, 2013 02:31:19 GMT
    Connection: close
    Server: vCO Server

    < html > < head > < title > JBossWeb/2.0.1.GA - error report < / title > < style > <!-H1 {make-f
    amily:Tahoma, Arial, without serif; color: white; background-color: # 525-76; font-size: 22 p
    x ;} H2 {do-family: Tahoma, Arial, without serif; color: white; background-color: # 525 76}
    do-size: 16px ;} H3 {do-family: Tahoma, Arial, without serif; color: white; background}
    -color: # 525 76; do-size: 14px ;} BODY {do-family: Tahoma, Arial, without serif; color:}
    Black; background-color: white ;} B {do-family: Tahoma, Arial, without serif; color: whit}
    e; background-color: # 525 76 ;} P {do-family: Tahoma, Arial, without serif; background: w}
    Hite; color: black; do-size: 12px ;} A {color: black ;}} B.SID {color: black ;}} HR {co
    Lor: # 525 76 ;} --> < / style > < / head > < body > < h1 > State HTTP 400 - < / h1 > < HR size = "1".
    NoShade = "noshade" > < p > < b > enter < /b > < /p > < p > < b > report message < /b > < u > < / u > < / p > <
    p > < b > description < /b > < u > the request sent by the client was syntactically incorr
    (CT). < /u > < /p > < HR size = "1" noshade "noshade" = > < h3 JBossWeb/2.0.1.GA > < / h3 > < body / > < /.
    HTML >

    Hi jiang.

    Could you try without the quotes around the parameter d data?

    curl-i k - vcoadmin:vcoadmin of the user x POST h ' Content-Type: application / json ' https://192.168.1.7:8281 / api/stream/dec0e608 - 8 b 8
    3 4e32-8825-3e77ef31c4d7/presentation/instances - d {}

    -Ilian

Maybe you are looking for