When I upload artifact to the ApiCurio registry using UI it works fine but if I use CURL for the same artifact, Documentation tab is empty. Any ideas?
I use:
curl -X POST -H "Content-type: application/json" -H "X-Registry-ArtifactType: OPENAPI" -H "X-Registry-ArtifactId: test" --data "{$body}" http://registry:8080/api/artifacts
should use "$body" instead of "{$body}"
Related
in my Github action I use a temporary variable for a timestamp and want to send this variable in a webhook, but github cant interpret the $var in string. Can someone pls help me?
The code looks like this:
- name: Posting Rocketchat
if: failure()
run: |
TS=$(date +%Y%m%d%H%M%S)
curl -X POST -H 'Content-Type: application/json' --data '{"text":"❌ Test: Leads Testing Desktop 💻","image_url":"https://myurl.net/$TS-1.png"}' https://chat.myurl.com/hooks/yxyxyxxyxyxyx/xxxxxyxyxyxyxyxyxy
Use instead
- name: Posting Rocketchat
if: failure()
run: |
echo "TS=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
curl -X POST -H 'Content-Type: application/json' --data '{"text":"❌ Test: Leads Testing Desktop 💻","image_url":"https://myurl.net/${{ env.TS }}-1.png"}' https://chat.myurl.com/hooks/yxyxyxxyxyxyx/xxxxxyxyxyxyxyxyxy
I am trying to pull a project ID using gitlab REST API v4, but when I issue the curl command, I get this error:
"jobs:test:script config should be a string or an array of strings"
The command is this one:
curl -k -H "PRIVATE-TOKEN: PRIVATE-TOKEN" "https://gitlab.nbg992.poc.dcn.telekom.de/api/v4/projects?search=$CI_PROJECT_NAME"
I tried to single quote it:
'curl -k -H "PRIVATE-TOKEN: PRIVATE-TOKEN" "https://gitlab.nbg992.poc.dcn.telekom.de/api/v4/projects?search=$CI_PROJECT_NAME"'
But when I do it, it removes the failure, but the command is ignored.
So I tried to eval it like this:
eval - 'curl -k -H "PRIVATE-TOKEN: PRIVATE-TOKEN" "https://gitlab.nbg992.poc.dcn.telekom.de/api/v4/projects?search=$CI_PROJECT_NAME"'
When I do it, the failure its produced again:
"jobs:test:script config should be a string or an array of strings"
Any clue how should I issue the curl command? I think what is causing the failure is the colon within the "PRIVATE-TOKEN: PRIVATE-TOKEN"
This worked for me
Declare Job variables in variables sections eg:
variables:
PRIVATE-TOKEN: "TokenValue"
PRIVATE_HEADER: "PRIVATE-TOKEN: ${PRIVATE-TOKEN}"
Then under Script Section of the CI file used Curl command as follows
script:
curl -k -H ${PRIVATE_HEADER} "https://gitlab.nbg992.poc.dcn.telekom.de/api/v4/projects?search=${CI_PROJECT_NAME}
Using the {} braces around variable names made sure that ":" issue doesn't show up
I want to upload my APK to Saucelabs, How can I do that?
Is there any tab do so ?
I am trying with Curl command as well, which is not working for me
Yes, U have to use curl command correctly.
Use below Link to download curl :
http://curl.haxx.se/download.html
After that use below curl command :
curl -u YOUR_SAUCE_USERNAME:YOUR_SAUCE_ACCESS_KEY -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/YOUR_SAUCE_USERNAME/YOUR_ANDROID_APP.apk
I need to create a Team repository usign Bitbucket's API.
To create a user repository I use to do so:
$ curl -k -X POST -u username:passwd "https://api.bitbucket.org/1.0/repositories" -d "name=myrep"
How would I do the same but for a team?
This explains how it works with the repositories endpoint of API 2:
$ team=myteam
$ repo=repository
$ curl -X POST -v -u username:password -H "Content-Type: application/json" \
https://api.bitbucket.org/2.0/repositories/${team}/${repo} \
-d '{"scm": "git", "is_private": "true", "fork_policy": "no_public_forks" }'
The difference from API 1 regarding how the data (-d) is handled is that API2 uses JSON format.
I have the following curl command:
curl -k -u sandboxer:sandboxer -D- -X POST -H "Content-Type: application/json" --data
'{"jql":"project = BNAP AND resolution = null AND status != Resolved AND status != Rejected",
"maxResults":2 ,
"fields":["KEY","versions","description","status","resolution"]}'
https://127.0.0.1/rest/api/latest/search 1> newtest
I recieve a JSON object with meta-data,
{"expand":"schema,names"
,"startAt":0
,"maxResults":2
,"total":74
...
All I am intersted in is what follows, issues. I could take care of this in my application, but I am wondering if there is a way I could just tell JIRA 'Don't send me meta-data'. Is there?
Use the Speakeasy plugin to create a custom request/response as a Jira extension:
Speakeasy plugin
Installing Speakeasy
Developing Speakeasy Extensions