I need to update the specification of a configuration parameter using Teamcity REST API.
Following the REST documentation I tried a PUT request with the parameter value like:
http://teamcity:80/httpAuth/app/rest/projects/TestProject/parameters/TestProjectParam
But this updates the value of the parameter, however I need to udpate the specification of the parameter. I am using Teamcity 8.0.6
I have no way of validating if this works with TeamCity 8.0.6, but the following will create/update a parameter with spec in TeamCity 8.1.3.
Request
POST http://teamcity:80/httpAuth/app/rest/projects/TestProject/parameters/
Headers
Content-Type: application/xml
Authorization: YourToken
Body
<property name="TestProjectParam" value="" own="true">
<type rawValue="select data_2='400' data_1='300' display='normal' data_3='500'" />
</property>
Related
I did the following setup in citrus-context.xml file to parameterize but it does only the value we set in endpoint.properties file. This needs to be dynamic nature in my case and URL should come from client request. Is that possible to configure dynamically? like wanted to use same automation code for two different domain url endpoints for dev and qa enviroments.
<citrus-http:client
id="service_endpoint"
request-url="${Service.Endpoint.URL}"
request-method="GET"
content-type="text/xml"
charset="UTF-8"
timeout="60000" />
endpoint.properties file
<context:property-placeholder location="classpath:endpoint.properties"/>
You can use the endpointUriResolver on the http-client endpoint as follows:
<citrus-http:client
...
endpoint-resolver="dynamicEndpointResolver"/>
<bean id="dynamicEndpointResolver"
class="com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver"/>
And the set the endpoint request URL in the test action as special header:
<header>
<element name="citrus_endpoint_uri"
value="http://${host}:${port}/${path}" />
</header>
How to set default SoapAction value for a soap service configured on wso2 api managaer 2.1.0.
For Soap services we do not have option to edit swagger definition:
please advise how do i default the value of soap action, in our scenario it is not relevant. if there is way to remove from ui and set default value for all api call that would also work. thank you.
If it's SOAP 1.2 you can simply ignore Soap Action.
If it's SOAP 1.1, you can have a custom mediation sequence and set SOAPAction http header like this.
<sequence xmlns="http://ws.apache.org/ns/synapse" name="admin--sample">
<property name="SOAPAction" scope="transport" expression="YourSoapActionHere"/>
</sequence>
If you want to modify the UI, you'll have to tweak this file.
repository/deployment/server/jaggeryapps/store/site/themes/wso2/templates/api/swagger/swagger/swagger-ui{.min}.js
I am trying to use the import endpoint of the Nifi REST API 1.0. I have exported a template as XML using the UI, and am trying to import it using Postman. The request looks like this:
POST /nifi-api/process-groups/63dcaf98-0158-1000-04da-dd54bbb3a5b8/templates/import HTTP/1.1
Host: localhost:8080
Content-Type: application/xml
Cache-Control: no-cache
Postman-Token: 37a10e8b-b30d-b5c8-4219-ca1ba34f79da
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description></description>
...
</template>
I get 400 error return, with message argument type mismatch. There's nothing very useful in the nifi-user.log:
2016-11-14 14:58:22,164 INFO [NiFi Web Server-327] org.apache.nifi.web.filter.RequestLogger Attempting request for (anonymous) POST http://localhost:8080/nifi-api/process-groups/63dcaf98-0158-1000-04da-dd54bbb3a5b8/templates/import (source ip: 127.0.0.1)
2016-11-14 14:58:22,231 INFO [NiFi Web Server-327] o.a.n.w.a.c.IllegalArgumentExceptionMapper java.lang.IllegalArgumentException: argument type mismatch. Returning Bad Request response.
Any ideas what may be causing this, or how I can debug?
Try wrapping the root template element with another element called templateEntity. Most endpoints in Apache NiFi 1.0.0 wrap the object in question with an entity object to relay relevant details about the object when access is denied for to help promote the multi-tenancy model. This pattern was applied to most endpoints to help with consistency throughout the API.
Also you can get to additional details by enabling debug level logging for
<logger name="org.apache.nifi.web.api.config" level="DEBUG" additivity="false">
in conf/logback.xml.
First you have to upload the template, with the following command ( I use curl):
curl -iv -F template=#Sample_Process_group.xml -X POST http://172.17.0.4:8080/nifi-api/process-groups/2a9c6a0d-015c-1000-dec6-e81122344f7e/templates/upload where the guid is your root Process Group.
I'm attempting to create a logon token using the BOE BI Platform RESTful SDK v4.1 (using RESTClient).
A GET request to http://server:6405/biprws/logon/long/ returns:
<attrs xmlns="http://www.sap.com/rws/bip">
<attr name="userName" type="string" />
<attr name="password" type="string" />
<attr name="auth" type="string" possibilities="secEnterprise,secLDAP,secWinAD,secSAPR3">secEnterprise</attr>
</attrs>
A POST to http://server:6405/biprws/logon/long/ with a single header of Content-Type: application/xml and a payload of
<attrs xmlns="http://www.sap.com/rws/bip">
<attr name="userName" type="string">myAccount</attr>
<attr name="password" type="string">myPassword</attr>
<attr name="auth" type="string" possibilities="secEnterprise,secLDAP,secWinAD,secSAPR3">secWinAD</attr>
</attrs>
returns:
<error>
<error_code>FWM 00006</error_code>
<message>Active Directory Authentication failed to log you on. Please contact your system administrator to make sure you are a member of a valid mapped group and try again. If you are not a member of the default domain, enter your user name as UserName#DNS_DomainName, and then try again. (FWM 00006)</message>
</error>
I've also tried attr name="userName" type="string">myAccount#mycompany.org</attr>, but with the same results.
A POST to http://server:6405/biprws/logon/adsso returns:
<error>
<error_code>RWS 00057</error_code>
<message>Method not allowed (RWS 00057)</message>
</error>
The credentials work with BI Launchpad and the CMC.
What am I missing?
First, a disclaimer -- I've only done REST WinAD with SSO, not manual logon. So I can't be absolutely sure that my suggestions below will fix your problem.
The call to /biprws/logon/adsso requires a GET not a POST, but that will likely not work until you have SSO working.
There are a few settings that are required for WACS to use WinAD, with or without SSO. The file is here:
SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\pjs\services\RestWebService\biprws\WEB-INF\web.xml
You will see a section commented out, starting with:
<!-- Kerberos filter section starts
Uncomment this section. Then set the following parameters:
idm.realm
idm.princ
idm.keytab
idm.kdc
idm.allowUnsecured
The values for these parameters should equal what was set in your system for BI launch pad. This is in:
SAP BusinessObjects\tomcat\webapps\BOE\WEB-INF\config\custom\global.properties
The format of the file is different (global.properties is a simple properties file, but web.xml is xml). So you can't just copy/paste the section, but you can copy the individual values. For example, in global.properties, you might see:
idm.keytab=C:/WINDOWS/bosso.keytab
This would be done in web.xml as:
<init-param>
<param-name>idm.keytab</param-name>
<param-value>C:/WINDOWS/bosso.keytab</param-value>
<description>
The file containing the keytab that Kerberos will use for
user-to-service authentication. If unspecified, SSO will default
to using an in-memory keytab with a password specified in the
com.wedgetail.idm.sso.password environment variable.
</description>
</init-param>
Couple of references:
http://myinsightbi.blogspot.com/
https://techwriter79.wikispaces.com/file/view/sbo41sp5_bip_rest_ws_en.pdf
I'm sending create or update template registration requests to my Azure Notification Hub using the REST API, but my requests always get rejected for template registrations for Windows Notification Service while it works for all other service types.
The body of my request looks correct to me, when I compare it with the documentation:
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<content type="application/xml">
<WindowsTemplateRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
<Tags>SomeTag:1,TEST_REGISTRATION</Tags>
<ChannelUri>https://db3.notify.windows.com/?token=AgY7AABrfRCVgRV%2ba4DwoDjC2omrnOVwCkdhCrrzlJi6UpIwHzcig6%2fG5xZfnDqU0%2fXoE848ddiqyTaTlSSltp2Dn9Z3qaPsMAyh7kS%2bmlis1%2bwoh%2b%2b4DsAK1yeV1d9G1rUIuFs%3s</ChannelUri>
<BodyTemplate><![CDATA[<?xml version="1.0" encoding="utf-8" ?><data><title>$(title_en)</title><message>$(message_en)</message><notificationType>1</notificationType></data>]]></BodyTemplate>
<WnsHeaders>
<WNSHeader>
<Header>X-WNS-Type</Header>
<Value>wns/raw</Value>
</WNSHeader>
</WnsHeaders>
</WindowsTemplateRegistrationDescription>
</content>
</entry>
ANH always returns the response code 400 (Invalid request body. The registration could not be created because the request was malformed.), but using this format works for all other service types (e.g. GCM, MPNS) and I can create a WNS template registration manually using the Service Bus Explorer with the exact same ChannelUri, template and WnsHeaders.
What else could be wrong here? Is there any way to debug this?
Found the answer in this question: What does the following Azure Notification Hub REST response mean: 'The specified resource description is invalid.'?
"WNSHeader" needs to be written in Pascal case, like this: "WnsHeader", so the documentation is not 100% correct...