api-v1, javascript #1

Merged
quentin merged 5 commits from v0.9.x into main 2023-11-28 15:36:32 +00:00
2 changed files with 26 additions and 26 deletions
Showing only changes of commit 94a2301408 - Show all commits

View file

@ -63,7 +63,7 @@ Name | Type | Description | Notes
## deleteKey
> deleteKey(accessKey)
> deleteKey(id)
Delete a key
@ -79,8 +79,8 @@ let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
apiInstance.deleteKey(accessKey).then(() => {
let id = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
apiInstance.deleteKey(id).then(() => {
console.log('API called successfully.');
}, (error) => {
console.error(error);
@ -93,7 +93,7 @@ apiInstance.deleteKey(accessKey).then(() => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessKey** | **String**| The exact API access key generated by Garage |
**id** | **String**| The exact API access key generated by Garage |
### Return type
@ -257,7 +257,7 @@ This endpoint does not need any parameter.
## updateKey
> KeyInfo updateKey(accessKey, updateKeyRequest)
> KeyInfo updateKey(id, updateKeyRequest)
Update a key
@ -273,9 +273,9 @@ let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new garage.KeyApi();
let accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
let id = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
let updateKeyRequest = new garage.UpdateKeyRequest(); // UpdateKeyRequest | For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove
apiInstance.updateKey(accessKey, updateKeyRequest).then((data) => {
apiInstance.updateKey(id, updateKeyRequest).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
@ -288,7 +288,7 @@ apiInstance.updateKey(accessKey, updateKeyRequest).then((data) => {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessKey** | **String**| The exact API access key generated by Garage |
**id** | **String**| The exact API access key generated by Garage |
**updateKeyRequest** | [**UpdateKeyRequest**](UpdateKeyRequest.md)| For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove |
### Return type

View file

@ -89,20 +89,20 @@ export default class KeyApi {
/**
* Delete a key
* Delete a key from the cluster. Its access will be removed from all the buckets. Buckets are not automatically deleted and can be dangling. You should manually delete them before.
* @param {String} accessKey The exact API access key generated by Garage
* @param {String} id The exact API access key generated by Garage
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
deleteKeyWithHttpInfo(accessKey) {
deleteKeyWithHttpInfo(id) {
let postBody = null;
// verify the required parameter 'accessKey' is set
if (accessKey === undefined || accessKey === null) {
throw new Error("Missing the required parameter 'accessKey' when calling deleteKey");
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling deleteKey");
}
let pathParams = {
'access_key': accessKey
};
let queryParams = {
'id': id
};
let headerParams = {
};
@ -123,11 +123,11 @@ export default class KeyApi {
/**
* Delete a key
* Delete a key from the cluster. Its access will be removed from all the buckets. Buckets are not automatically deleted and can be dangling. You should manually delete them before.
* @param {String} accessKey The exact API access key generated by Garage
* @param {String} id The exact API access key generated by Garage
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
deleteKey(accessKey) {
return this.deleteKeyWithHttpInfo(accessKey)
deleteKey(id) {
return this.deleteKeyWithHttpInfo(id)
.then(function(response_and_data) {
return response_and_data.data;
});
@ -278,15 +278,15 @@ export default class KeyApi {
/**
* Update a key
* Updates information about the specified API access key. *Note: the secret key is not returned in the response, `null` is sent instead.*
* @param {String} accessKey The exact API access key generated by Garage
* @param {String} id The exact API access key generated by Garage
* @param {module:model/UpdateKeyRequest} updateKeyRequest For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/KeyInfo} and HTTP response
*/
updateKeyWithHttpInfo(accessKey, updateKeyRequest) {
updateKeyWithHttpInfo(id, updateKeyRequest) {
let postBody = updateKeyRequest;
// verify the required parameter 'accessKey' is set
if (accessKey === undefined || accessKey === null) {
throw new Error("Missing the required parameter 'accessKey' when calling updateKey");
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling updateKey");
}
// verify the required parameter 'updateKeyRequest' is set
if (updateKeyRequest === undefined || updateKeyRequest === null) {
@ -294,9 +294,9 @@ export default class KeyApi {
}
let pathParams = {
'access_key': accessKey
};
let queryParams = {
'id': id
};
let headerParams = {
};
@ -317,12 +317,12 @@ export default class KeyApi {
/**
* Update a key
* Updates information about the specified API access key. *Note: the secret key is not returned in the response, `null` is sent instead.*
* @param {String} accessKey The exact API access key generated by Garage
* @param {String} id The exact API access key generated by Garage
* @param {module:model/UpdateKeyRequest} updateKeyRequest For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/KeyInfo}
*/
updateKey(accessKey, updateKeyRequest) {
return this.updateKeyWithHttpInfo(accessKey, updateKeyRequest)
updateKey(id, updateKeyRequest) {
return this.updateKeyWithHttpInfo(id, updateKeyRequest)
.then(function(response_and_data) {
return response_and_data.data;
});