Go (SDK)
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ObjectStorage.GetStorageBucketAccessKeys(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.objectStorage.getStorageBucketAccessKeys({
id: "<id>",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/storage/buckets/{id}/access_keys \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/storage/buckets/{id}/access_keys"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/storage/buckets/{id}/access_keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/storage/buckets/{id}/access_keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/storage/buckets/{id}/access_keys")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/buckets/{id}/access_keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "key1",
"username": "testuser+key1@example.com",
"access_key_id": "AKIA123456789",
"status": "Active",
"created_at": "2024-01-01T00:00:00Z",
"access": "fullaccess"
}
]
}{
"errors": [
{
"code": "USER_AUTHORIZATION_ERROR",
"status": "forbidden",
"title": "User Authorization Error",
"detail": "You are not authorized to perform this action.",
"meta": {}
}
]
}{
"errors": [
{
"code": "NOT_FOUND",
"message": "Object storage not found"
}
]
}Object Storage
List bucket access keys
Lists IAM access keys associated with an object storage bucket. Secrets are never returned by this endpoint.
GET
/
storage
/
buckets
/
{id}
/
access_keys
Go (SDK)
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ObjectStorage.GetStorageBucketAccessKeys(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.objectStorage.getStorageBucketAccessKeys({
id: "<id>",
});
console.log(result);
}
run();curl --request GET \
--url https://api.latitude.sh/storage/buckets/{id}/access_keys \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/storage/buckets/{id}/access_keys"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/storage/buckets/{id}/access_keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/storage/buckets/{id}/access_keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/storage/buckets/{id}/access_keys")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/buckets/{id}/access_keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"name": "key1",
"username": "testuser+key1@example.com",
"access_key_id": "AKIA123456789",
"status": "Active",
"created_at": "2024-01-01T00:00:00Z",
"access": "fullaccess"
}
]
}{
"errors": [
{
"code": "USER_AUTHORIZATION_ERROR",
"status": "forbidden",
"title": "User Authorization Error",
"detail": "You are not authorized to perform this action.",
"meta": {}
}
]
}{
"errors": [
{
"code": "NOT_FOUND",
"message": "Object storage not found"
}
]
}Was this page helpful?
⌘I