How to fork a repository to a namespace using gitLab API - git-fork

Currently we're still using gitLab with a single group for all teams. We need to switch from everyone using branches on one main repo to having forked repositories in different groups.
We need to be able to
-Automatically create a new group with the existing repositories forked and branched
The current setup returns a 404 for some reason.
curl --request POST --header "PRIVATE-TOKEN: xxxxxxxxxxxxxxxx" http://gitlab.exampleRepo.com/api/v4/projects/84/myNamespace/fork
Any help would be great guys.

Got it sorted in the end. I needed to put data with namespace before --header in the command. I used curl --request POST --data "namespace=team_name" --header "PRIVATE-TOKEN: xxxxxxxxxxxx" gitlab.exampleRepo.com/api/v4/projects/project_ID/fork

Use double quotes around the url to pass multiple option (&).
curl --request POST --data "namespace=team_name" --header "PRIVATE-TOKEN: xxxxxxxxxxxx" "https://gitlab.com/api/v4/projects/project%2project_ID/fork?path=test_path&name=test_name"

Related

The vespa returns an error when I put one document with documentAPI

I build vespa, and install it on physical machine, call /opt/vespa/bin/vespa-start-configserver and /opt/vespa/bin/vespa-start-services .
I submit my application package normally, and http://localhost:19071/application/v2/tenant/ourtenant/application/ works fine.
But when I feed it with one document, it failed:
curl -H "Content-Type:application/json" --data-binary #/opt/samples/bd-search-data/english1.json
http://localhost:8080/document/v1/mynamespace/kosmos/docid/1
response:
{"errors":[{"description":"DOCUMENT_EXCEPTION [ENCODE_ERROR # localhost]: Protocol 'document' failed to encode message. ","id":-11}],"id":"id:mynamespace:kosmos::1","pathId":"/document/v1/mynamespace/kosmos/docid/1"}
Anyone can tell me why?

cloudant badmatch error when using deisgn document but the same query works when not using views

Can someone please help me resolve the query error when using views?
I run this inside cloudant docker container where this issue shows up intermittently. I cannot reproduce the problem on all container starts but wanted to check how to resolve this without having to delete and re-create the container. Appreciate any help.
curl --user admin:pass "http://localhost:/basic/_design/example/_view/foo"
{"error":"badmatch","reason":"{error,enoent}","ref":2451670243}
curl --user admin:pass "http://localhost:/basic/_design/example"
{"_id":"_design/example","_rev":"1-230141dfa7e07c3dbfef0789bf11773a","views":{"foo":{"map":"function(doc){ emit(doc._id, doc._rev)}"}}}

How to execute FIND Rest API call in Appery.io

Currently I am working on an app which is being developed using Cordova and Appery.io. I want to make Find api call in user table. But it always gives me StatusCode:400 it means Bad request. Here is my URL for this api call
'https://api.appery.io/rest/1/db/users?where={"username":"suryajeet.singh#mobiloittegroup.com"}'
Any idea what I am doing wrong to make this api call? Quick response will be appreciable. Thanks in advance.
You have to use database master key to query Users collection, see
https://docs.appery.io/docs/database-settings
curl -X GET \
-H "X-Appery-Database-Id: 57928860e4b00ef864f3dc24" \
-H "X-Appery-Master-Key: 7ec7f59e-475d-49ba-a2d1-fc22df51eb55" \
-G --data-urlencode 'where={"username":"suryajeet.singh#mobiloittegroup.com"} \
https://api.appery.io/rest/1/db/users
More info can be found at https://docs.appery.io/reference#database-api-user

How to upload file using loopback api explorer?

I'm using loopback Api Explorer I need to upload a file by explore how can I upload that because I don't find any option to upload file please refer the screenshot
.
Simply put, the answer is that you can't. Uploading a file requires multi-part form data. This isn't currently possible via the loopback-component-explorer. You should checkout the loobpack-component-storage instead. There is an example here; I recommend using the example-2.0.
You can test it with something like POSTMAN.
But, the only that you need, is the path of the file, not the file.
Simpler than using Postman would be using curl direct on the terminal :
Here is the command I use when need(I work with some services using loopback/explorer as well) :
curl -i -X POST -H "Content-Type: multipart/form-data" -F "blob=#/path/to/your/file.jpg" -v http://HOST:PORT/pathToYourEndpoint?access_token=xxxxxxxxxxx

"Bad Content Type" using Curl with GAE Blobstore

I'm using blobstore.create_upload_url('/upload') to generate a url for a POST request that I will send a jpeg. App engine returns a URL correctly. Given the URL I've been using curl to post the picture but I keep getting "Bad content type. Please use multipart" returned.
Does anybody have any ideas how to deal with this? I searched a bit and didn't find a whole lot.
Curl command: curl -X POST -d #download.jpg --header "Content-Type:multipart/form-data" LINK_FROM_GAE
Edit: I also tried
curl --form "fileupload=#download.jpg" --header "Content-Type:multipart/form-data" LINK_FROM_GAE
without any luck.

Resources