Skip to content

javiermugueta/oci-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ocirest

bash wrapper for OCI REST API

setup instructions

clone this repo

git clone https://github.com/javiermugueta/oci-rest.git
cd ocirest
chmod 700 oci-rest samples.sh

put your env data in my-oci-env file

try some samples with samples.sh

OCI REST API: https://docs.cloud.oracle.com/en-us/iaas/api/

execution

oci-rest <api-endpoint-without-protocol> [<file with json body for post verb>] <verb> <method>

Example 1

./oci-rest objectstorage.eu-frankfurt-1.oraclecloud.com get "/n/"

Example 2

cat <<EOF > body.json
{
	"granularity": "HOURLY",
	"tenantId": "ocid1.tenancy.oc1..aaaaaaaaei...",
	"timeUsageStarted": "2021-02-10T00:00:00.000Z",
	"timeUsageEnded": "2021-02-11T00:00:00.000Z"
}
EOF
./oci-rest usageapi.eu-frankfurt-1.oci.oraclecloud.com post body.json "/20200107/usage"

troubleshooting

You get this:

{
  "code" : "NotAuthorizedOrNotFound",
  "message" : "Authorization failed or requested resource not found."
}

Reason: Typo error in the method or, if correct, you don't have permissions to use the endpoint

You get this:

{
  "code" : "NotAuthenticated",
  "message" : "The required information to complete authentication was not provided or was incorrect."
}

Reason: error in my-oci-env data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages