Skip to Main Content

LiveLabs & Workshops

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to pass the query section in REST API ( trying via oci raw-request )

Tamilselvan_sankaran-OracleJul 16 2022 — edited Jul 16 2022

oci raw-request --http-method GET --target-uri https://objectstorage.ap-melbourne-1.oraclecloud.com/n/axatkk9parjt/b --request-body "file:///home/tamiloracl/compartment.json"
{
"data": {
"code": "MissingCompartmentId",
"message": "The 'compartmentId' query parameter was missing"
},
"headers": {
"Content-Length": "91",
"Content-Type": "application/json",
"access-control-allow-credentials": "true",
"access-control-allow-methods": "POST,PUT,GET,HEAD,DELETE,OPTIONS",
"access-control-allow-origin": "*",
"access-control-expose-headers": "access-control-allow-credentials,access-control-allow-methods,access-control-allow-origin,content-length,content-type,date,opc-client-info,opc-request-id,x-api-id",
"date": "Sat, 16 Jul 2022 10:03:23 GMT",
"opc-request-id": "mel-1:Q9lECIeC9_w87ppIOiofT0Ehz1oDvu5fPt97jpo3a4NSapit8w5Y0l-GYEhCy_Uw",
"x-api-id": "native"
},
"status": "400 Bad Request"
}

The compartment.json have the json data of compartmentID
https://docs.oracle.com/en-us/iaas/api/#/en/objectstorage/20160918/Bucket/ListBuckets
The compartmentID parameter needs to mention at query part. Could you please help me how to pass this compartment-id
I am able to confirm that my api user is working by getting the status of the bucket.
oci raw-request --http-method GET --target-uri https://objectstorage.ap-melbourne-1.oraclecloud.com/n/axatkk9parjt/b/test1
{
"data": {
.....
},
"status": "200 OK"
}
But when I try the list bucket api , I am not able to find an example to pass the parameter query part.

Comments
Post Details
Added on Jul 16 2022
1 comment
528 views