error when importing robotframework result into xray - rest

I want to import the result of my execution (robot framework) with REST API into JIRA. I used the following command
curl --insecure -H "Content-Type: multipart/form-data" -D- -p -F "file=#outputXX.xml" "https://portail.agir.orange.com/rest/raven/1.0/import/execution/robot?projectKey=MY"
I have this error:
{"error":"Cannot add label with invalid validation result!"}
This error is not clear enough to know exactly the problem's origin.
Could anyone help me ?

I found the reason of this error:
the label refers to the TAG in robot framework
my TAG is JIRA was CONNECT_ID or in my test the tag is CONNECT ID , the space caused this error
I hope my answer helps other!

Related

How do I search by checksum (SHA1, etc...) with Nexus 3 REST API?

I had a look at the documentation of the API but did not find a listing of all the possible query parameters, and in particular, could not find an appropriate parameter to search by SHA1, or other checksum :
https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/search-api
https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/assets-api
Previously in Nexus 2 it was possible to do this with 2 endpoints data_index and lucene :
https://repository.sonatype.org/service/local/lucene/search?sha1=686ef3410bcf4ab8ce7fd0b899e832aaba5facf7
https://nexus.xwiki.org/nexus/service/local/data_index?sha1=686ef3410bcf4ab8ce7fd0b899e832aaba5facf7
I had a look at what endpoint Nexus 3 queries internally, and it's again another endpoint called extdirect which uses POST.
I found on some other post that it is already deprecated https://groups.google.com/a/glists.sonatype.com/g/nexus-users/c/8_DyIZrt9mM
Other answers didn't help, in fact I couldn't find 2 answers that agree on the parameter names.
Here it's a strange spelling of artifact spelled artefact with a 'e'
Can't download using Nexus 3 REST API and CURL
curl -u username:password -L -X GET "https://mynexusserver/service/rest/v1/search/assets/download?sort=version&repository=snapshotsrepo&maven.groupId=mygroup&maven.artefactId=myartefact&maven.extension=zip" -H "accept: application/json" -o myartefact.zip
In this answer, the parameters are again different:
https://stackoverflow.com/a/71126636/8315843
curl -u token:tokenPassword -L -X GET "https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&group=MY_GROUP&name=MY_ARTIFACT_NAME&version=MY_Version&maven.extension=zip" --output My_Artifact.zip
So, for artifact, is it maven.artifactId or name ?
For group, is it maven.groupId or group ?
How would I get token:tokenPassword ? Can't I just use username:password ?

IBM Cloud API Docs Tone Analyzer

I tried to implement :
curl -u "apikey:{apikey}" "{url}/{method}"
resorce:https://console.bluemix.net/apidocs/tone-analyzer
My question what I need to do? I already have the api key, for example 1234,
and my url is https://gateway.watsonplatform.net/tone-analyzer/api
First what is the: {method} in the above cURL request and what do I need to do with that?
Question 2 this is correct?:
curl -u "apikey:1234" "https://gateway.watsonplatform.net/tone-analyzer/api/{method}
In the cURL request below:
curl -X GET -u "apikey:{apikey}" "https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version=2017-09-21&text=Team,%20I%20know%20that%20times%20are%20tough!%20Product%20sales%20have%20been%20disappointing%20for%20the%20past%20three%20quarters.%20We%20have%20a%20competitive%20product,%20but%20we%20need%20to%20do%20a%20better%20job%20of%20selling%20it!"
The {URL} is https://gateway.watsonplatform.net/tone-analyzer/api and {method} is /v3/tone. To under the endpoint, check this link
You are making a GET method call and for this, you need to create a service at https://console.bluemix.net/catalog/services/tone-analyzer
For more information on how to get an API key, refer to this link

Request new Swarm Review via Command Line

i want to access the "Request New Swarm Review" functionality in the P4V GUI for Perforce inside the command line. I did a lot of research but none of my attempts was successful. I tried:
"p4 shelve -c changelistNumber #review" like it is discussed in this post: Submit a change for review in swarm command line using perforce
In this case i get an error like: Invalid revision number 'review'
"$ curl -u "apiuser:password" -d"change=12345" https://myswarm.url/api/v9/reviews" like it is written in the Swarm API (https://www.perforce.com/perforce/doc.current/manuals/swarm/Content/Swarm/swarm-apidoc.html). In this case i get an error like: curl: no URL specified
Im using windows 7, 64bit
Could anyone give me a hint to point me in the correct direction? Thank you in advance! Jakob
I think your second solution was pretty close, you just needed to make it a POST. The following worked for me:
curl -X POST http://*YOUR_SWARM_URL*/api/v9/reviews --data-urlencode "change=*YOUR_CHANGE_ID*"
Note that I'd prefer #2 over #1 because it doesn't rely on triggers.

Bluemix - Natural Language Classifier credentials in the Questions on classifier demo

I'm trying to use IBM Watson Natural language Classifier but I can't proceed and load my answers. For some reason, username and password aren't working all the time.
This one executed fine:
curl -u username:password -F training_data=#questions.csv -F
training_metadata="{\"language\":\"en\",\"name\":\"my_classifier\"}"
"https://url/v1/classifiers"
But when I try to execute the following command, it doesn't work:
curl -u username:password -X POST -H "Content-Type: application/json"
-d #questions-with-classifier-ega-war/target/classes/answers.json http://yourAppName.mybluemix.net/api/v1/manage/answer
It just asks for the user and password again and again. It is the same password that just worked in the first curl command.
Thanks in advance!
I think you are confusing the service credentials (the one you use in the first command) with the credentials used to manage the database in one of the sample applications "Questions on Classifier" (see pom.xml).
In order to run your second command make sure you use the credentials from the pom.xml in your root directory

Correcting SOAP Fault Method not Implemented Errors

OK, not sure what this problem is. I am trying to post an API request to PayPal via cURL and I get the following result. Is there something that I am missing in my call that would cause this?
According to PayPal, the call is correct and it works fine when I use the PHP cURL wrapper functions...Weird.
Thanks for helping!
curl https://api.sandbox.paypal.com/2.0/ -H "X-PAYPAL-SECURITY-USERID: api1.sitetest.com" -H "X-PAYPAL-SECURITY-PASSWORD: 111222222UH24" -H "X-PAYPAL-DEVICE-IPADDRESS: 170.10.125.52" -H "X-PAYPAL-MESSAGE-PROTOCOL: SOAP11" -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" -E "/Users/Me/Library/PayPal_Keys/cert_key_pem.txt" -d "<SOAP-ENV:Envelope xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><SOAP-ENV:Header /><SOAP-ENV:Body><CreateAndSendInvoiceRequest><requestEnvelope><errorLanguage>en_US</errorLanguage></requestEnvelope><invoice><merchantEmail>sweet#sweetsounds.com</merchantEmail><payerEmail>me#testsite.com</payerEmail><businessName>Test Business, Inc.</businessName><logoURL></logoURL><itemList><item><name>Test Item</name><quantity>2</quantity><unitPrice>5.79</unitPrice><taxName>sales</taxName><taxRate>6.0</taxRate></item></itemList></invoice></CreateAndSendInvoiceRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>"
Returns
<SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Method not implemented</faultstring></SOAP-ENV:Fault>
Solved this. PayPal changed the sandbox api url for this particular call and did not update that in their docs.
new url for sandbox is "https://api-3t.sandbox.paypal.com/2.0/". You can test your commands here