api-v1, javascript #1
6 changed files with 99 additions and 302 deletions
|
@ -83,7 +83,3 @@ src/model/UpdateBucketRequestWebsiteAccess.js
|
||||||
src/model/UpdateKeyRequest.js
|
src/model/UpdateKeyRequest.js
|
||||||
src/model/UpdateKeyRequestAllow.js
|
src/model/UpdateKeyRequestAllow.js
|
||||||
src/model/UpdateKeyRequestDeny.js
|
src/model/UpdateKeyRequestDeny.js
|
||||||
test/model/ApplyLayout200Response.spec.js
|
|
||||||
test/model/NodeRoleChange.spec.js
|
|
||||||
test/model/NodeRoleRemove.spec.js
|
|
||||||
test/model/NodeRoleUpdate.spec.js
|
|
||||||
|
|
20
README.md
20
README.md
|
@ -127,23 +127,21 @@ Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
*garage.BucketApi* | [**allowBucketKey**](docs/BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key
|
*garage.BucketApi* | [**allowBucketKey**](docs/BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key
|
||||||
*garage.BucketApi* | [**createBucket**](docs/BucketApi.md#createBucket) | **POST** /bucket | Create a bucket
|
*garage.BucketApi* | [**createBucket**](docs/BucketApi.md#createBucket) | **POST** /bucket | Create a bucket
|
||||||
*garage.BucketApi* | [**deleteBucket**](docs/BucketApi.md#deleteBucket) | **DELETE** /bucket?id={bucket_id} | Delete a bucket
|
*garage.BucketApi* | [**deleteBucket**](docs/BucketApi.md#deleteBucket) | **DELETE** /bucket | Delete a bucket
|
||||||
*garage.BucketApi* | [**deleteBucketGlobalAlias**](docs/BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias
|
*garage.BucketApi* | [**deleteBucketGlobalAlias**](docs/BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias
|
||||||
*garage.BucketApi* | [**deleteBucketLocalAlias**](docs/BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias
|
*garage.BucketApi* | [**deleteBucketLocalAlias**](docs/BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias
|
||||||
*garage.BucketApi* | [**denyBucketKey**](docs/BucketApi.md#denyBucketKey) | **POST** /bucket/deny | Deny key
|
*garage.BucketApi* | [**denyBucketKey**](docs/BucketApi.md#denyBucketKey) | **POST** /bucket/deny | Deny key
|
||||||
*garage.BucketApi* | [**findBucketInfo**](docs/BucketApi.md#findBucketInfo) | **GET** /bucket?globalAlias={alias} | Find a bucket
|
*garage.BucketApi* | [**getBucketInfo**](docs/BucketApi.md#getBucketInfo) | **GET** /bucket | Get a bucket
|
||||||
*garage.BucketApi* | [**getBucketInfo**](docs/BucketApi.md#getBucketInfo) | **GET** /bucket?id={bucket_id} | Get a bucket
|
*garage.BucketApi* | [**listBuckets**](docs/BucketApi.md#listBuckets) | **GET** /bucket?list | List all buckets
|
||||||
*garage.BucketApi* | [**listBuckets**](docs/BucketApi.md#listBuckets) | **GET** /bucket | List all buckets
|
|
||||||
*garage.BucketApi* | [**putBucketGlobalAlias**](docs/BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global alias
|
*garage.BucketApi* | [**putBucketGlobalAlias**](docs/BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global alias
|
||||||
*garage.BucketApi* | [**putBucketLocalAlias**](docs/BucketApi.md#putBucketLocalAlias) | **PUT** /bucket/alias/local | Add a local alias
|
*garage.BucketApi* | [**putBucketLocalAlias**](docs/BucketApi.md#putBucketLocalAlias) | **PUT** /bucket/alias/local | Add a local alias
|
||||||
*garage.BucketApi* | [**updateBucket**](docs/BucketApi.md#updateBucket) | **PUT** /bucket?id={bucket_id} | Update a bucket
|
*garage.BucketApi* | [**updateBucket**](docs/BucketApi.md#updateBucket) | **PUT** /bucket | Update a bucket
|
||||||
*garage.KeyApi* | [**addKey**](docs/KeyApi.md#addKey) | **POST** /key | Create a new API key
|
*garage.KeyApi* | [**addKey**](docs/KeyApi.md#addKey) | **POST** /key?list | Create a new API key
|
||||||
*garage.KeyApi* | [**deleteKey**](docs/KeyApi.md#deleteKey) | **DELETE** /key?id={access_key} | Delete a key
|
*garage.KeyApi* | [**deleteKey**](docs/KeyApi.md#deleteKey) | **DELETE** /key | Delete a key
|
||||||
*garage.KeyApi* | [**getKey**](docs/KeyApi.md#getKey) | **GET** /key?id={access_key} | Get key information
|
*garage.KeyApi* | [**getKey**](docs/KeyApi.md#getKey) | **GET** /key | Get key information
|
||||||
*garage.KeyApi* | [**importKey**](docs/KeyApi.md#importKey) | **POST** /key/import | Import an existing key
|
*garage.KeyApi* | [**importKey**](docs/KeyApi.md#importKey) | **POST** /key/import | Import an existing key
|
||||||
*garage.KeyApi* | [**listKeys**](docs/KeyApi.md#listKeys) | **GET** /key | List all keys
|
*garage.KeyApi* | [**listKeys**](docs/KeyApi.md#listKeys) | **GET** /key?list | List all keys
|
||||||
*garage.KeyApi* | [**searchKey**](docs/KeyApi.md#searchKey) | **GET** /key?search={pattern} | Select key by pattern
|
*garage.KeyApi* | [**updateKey**](docs/KeyApi.md#updateKey) | **POST** /key | Update a key
|
||||||
*garage.KeyApi* | [**updateKey**](docs/KeyApi.md#updateKey) | **POST** /key?id={access_key} | Update a key
|
|
||||||
*garage.LayoutApi* | [**addLayout**](docs/LayoutApi.md#addLayout) | **POST** /layout | Send modifications to the cluster layout
|
*garage.LayoutApi* | [**addLayout**](docs/LayoutApi.md#addLayout) | **POST** /layout | Send modifications to the cluster layout
|
||||||
*garage.LayoutApi* | [**applyLayout**](docs/LayoutApi.md#applyLayout) | **POST** /layout/apply | Apply staged layout
|
*garage.LayoutApi* | [**applyLayout**](docs/LayoutApi.md#applyLayout) | **POST** /layout/apply | Apply staged layout
|
||||||
*garage.LayoutApi* | [**getLayout**](docs/LayoutApi.md#getLayout) | **GET** /layout | Details on the current and staged layout
|
*garage.LayoutApi* | [**getLayout**](docs/LayoutApi.md#getLayout) | **GET** /layout | Details on the current and staged layout
|
||||||
|
|
|
@ -6,16 +6,15 @@ Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**allowBucketKey**](BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key
|
[**allowBucketKey**](BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key
|
||||||
[**createBucket**](BucketApi.md#createBucket) | **POST** /bucket | Create a bucket
|
[**createBucket**](BucketApi.md#createBucket) | **POST** /bucket | Create a bucket
|
||||||
[**deleteBucket**](BucketApi.md#deleteBucket) | **DELETE** /bucket?id={bucket_id} | Delete a bucket
|
[**deleteBucket**](BucketApi.md#deleteBucket) | **DELETE** /bucket | Delete a bucket
|
||||||
[**deleteBucketGlobalAlias**](BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias
|
[**deleteBucketGlobalAlias**](BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias
|
||||||
[**deleteBucketLocalAlias**](BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias
|
[**deleteBucketLocalAlias**](BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias
|
||||||
[**denyBucketKey**](BucketApi.md#denyBucketKey) | **POST** /bucket/deny | Deny key
|
[**denyBucketKey**](BucketApi.md#denyBucketKey) | **POST** /bucket/deny | Deny key
|
||||||
[**findBucketInfo**](BucketApi.md#findBucketInfo) | **GET** /bucket?globalAlias={alias} | Find a bucket
|
[**getBucketInfo**](BucketApi.md#getBucketInfo) | **GET** /bucket | Get a bucket
|
||||||
[**getBucketInfo**](BucketApi.md#getBucketInfo) | **GET** /bucket?id={bucket_id} | Get a bucket
|
[**listBuckets**](BucketApi.md#listBuckets) | **GET** /bucket?list | List all buckets
|
||||||
[**listBuckets**](BucketApi.md#listBuckets) | **GET** /bucket | List all buckets
|
|
||||||
[**putBucketGlobalAlias**](BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global alias
|
[**putBucketGlobalAlias**](BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global alias
|
||||||
[**putBucketLocalAlias**](BucketApi.md#putBucketLocalAlias) | **PUT** /bucket/alias/local | Add a local alias
|
[**putBucketLocalAlias**](BucketApi.md#putBucketLocalAlias) | **PUT** /bucket/alias/local | Add a local alias
|
||||||
[**updateBucket**](BucketApi.md#updateBucket) | **PUT** /bucket?id={bucket_id} | Update a bucket
|
[**updateBucket**](BucketApi.md#updateBucket) | **PUT** /bucket | Update a bucket
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +116,7 @@ Name | Type | Description | Notes
|
||||||
|
|
||||||
## deleteBucket
|
## deleteBucket
|
||||||
|
|
||||||
> deleteBucket(bucketId)
|
> deleteBucket(id)
|
||||||
|
|
||||||
Delete a bucket
|
Delete a bucket
|
||||||
|
|
||||||
|
@ -133,8 +132,8 @@ let bearerAuth = defaultClient.authentications['bearerAuth'];
|
||||||
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
let apiInstance = new garage.BucketApi();
|
let apiInstance = new garage.BucketApi();
|
||||||
let bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
|
let id = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
|
||||||
apiInstance.deleteBucket(bucketId).then(() => {
|
apiInstance.deleteBucket(id).then(() => {
|
||||||
console.log('API called successfully.');
|
console.log('API called successfully.');
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -147,7 +146,7 @@ apiInstance.deleteBucket(bucketId).then(() => {
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
|
**id** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -313,61 +312,13 @@ Name | Type | Description | Notes
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
|
||||||
## findBucketInfo
|
|
||||||
|
|
||||||
> BucketInfo findBucketInfo(alias)
|
|
||||||
|
|
||||||
Find a bucket
|
|
||||||
|
|
||||||
Find a bucket by its global alias
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import garage from 'garage_administration_api_v0garage_v0_9_0';
|
|
||||||
let defaultClient = garage.ApiClient.instance;
|
|
||||||
// Configure Bearer access token for authorization: bearerAuth
|
|
||||||
let bearerAuth = defaultClient.authentications['bearerAuth'];
|
|
||||||
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
|
||||||
|
|
||||||
let apiInstance = new garage.BucketApi();
|
|
||||||
let alias = my_documents; // String | The exact global alias of one of the existing buckets
|
|
||||||
apiInstance.findBucketInfo(alias).then((data) => {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}, (error) => {
|
|
||||||
console.error(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**alias** | **String**| The exact global alias of one of the existing buckets |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**BucketInfo**](BucketInfo.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[bearerAuth](../README.md#bearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
|
|
||||||
## getBucketInfo
|
## getBucketInfo
|
||||||
|
|
||||||
> BucketInfo getBucketInfo(bucketId)
|
> BucketInfo getBucketInfo(opts)
|
||||||
|
|
||||||
Get a bucket
|
Get a bucket
|
||||||
|
|
||||||
Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
|
Given a bucket identifier (`id`) or a global alias (`alias`), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -379,8 +330,11 @@ let bearerAuth = defaultClient.authentications['bearerAuth'];
|
||||||
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
let apiInstance = new garage.BucketApi();
|
let apiInstance = new garage.BucketApi();
|
||||||
let bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
|
let opts = {
|
||||||
apiInstance.getBucketInfo(bucketId).then((data) => {
|
'id': b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87, // String | The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`.
|
||||||
|
'alias': my_documents // String | The exact global alias of one of the existing buckets. Incompatible with `id`.
|
||||||
|
};
|
||||||
|
apiInstance.getBucketInfo(opts).then((data) => {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -393,7 +347,8 @@ apiInstance.getBucketInfo(bucketId).then((data) => {
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
|
**id** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`. | [optional]
|
||||||
|
**alias** | **String**| The exact global alias of one of the existing buckets. Incompatible with `id`. | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -557,7 +512,7 @@ Name | Type | Description | Notes
|
||||||
|
|
||||||
## updateBucket
|
## updateBucket
|
||||||
|
|
||||||
> BucketInfo updateBucket(bucketId, updateBucketRequest)
|
> BucketInfo updateBucket(id, updateBucketRequest)
|
||||||
|
|
||||||
Update a bucket
|
Update a bucket
|
||||||
|
|
||||||
|
@ -573,9 +528,9 @@ let bearerAuth = defaultClient.authentications['bearerAuth'];
|
||||||
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
let apiInstance = new garage.BucketApi();
|
let apiInstance = new garage.BucketApi();
|
||||||
let bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
|
let id = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string
|
||||||
let updateBucketRequest = new garage.UpdateBucketRequest(); // UpdateBucketRequest | Requested changes on the bucket. Both root fields are optionals.
|
let updateBucketRequest = new garage.UpdateBucketRequest(); // UpdateBucketRequest | Requested changes on the bucket. Both root fields are optionals.
|
||||||
apiInstance.updateBucket(bucketId, updateBucketRequest).then((data) => {
|
apiInstance.updateBucket(id, updateBucketRequest).then((data) => {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -588,7 +543,7 @@ apiInstance.updateBucket(bucketId, updateBucketRequest).then((data) => {
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
|
**id** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string |
|
||||||
**updateBucketRequest** | [**UpdateBucketRequest**](UpdateBucketRequest.md)| Requested changes on the bucket. Both root fields are optionals. |
|
**updateBucketRequest** | [**UpdateBucketRequest**](UpdateBucketRequest.md)| Requested changes on the bucket. Both root fields are optionals. |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
|
@ -4,13 +4,12 @@ All URIs are relative to *http://localhost:3903/v1*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**addKey**](KeyApi.md#addKey) | **POST** /key | Create a new API key
|
[**addKey**](KeyApi.md#addKey) | **POST** /key?list | Create a new API key
|
||||||
[**deleteKey**](KeyApi.md#deleteKey) | **DELETE** /key?id={access_key} | Delete a key
|
[**deleteKey**](KeyApi.md#deleteKey) | **DELETE** /key | Delete a key
|
||||||
[**getKey**](KeyApi.md#getKey) | **GET** /key?id={access_key} | Get key information
|
[**getKey**](KeyApi.md#getKey) | **GET** /key | Get key information
|
||||||
[**importKey**](KeyApi.md#importKey) | **POST** /key/import | Import an existing key
|
[**importKey**](KeyApi.md#importKey) | **POST** /key/import | Import an existing key
|
||||||
[**listKeys**](KeyApi.md#listKeys) | **GET** /key | List all keys
|
[**listKeys**](KeyApi.md#listKeys) | **GET** /key?list | List all keys
|
||||||
[**searchKey**](KeyApi.md#searchKey) | **GET** /key?search={pattern} | Select key by pattern
|
[**updateKey**](KeyApi.md#updateKey) | **POST** /key | Update a key
|
||||||
[**updateKey**](KeyApi.md#updateKey) | **POST** /key?id={access_key} | Update a key
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,11 +111,11 @@ null (empty response body)
|
||||||
|
|
||||||
## getKey
|
## getKey
|
||||||
|
|
||||||
> KeyInfo getKey(accessKey, opts)
|
> KeyInfo getKey(opts)
|
||||||
|
|
||||||
Get key information
|
Get key information
|
||||||
|
|
||||||
Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. You can search by specifying the exact key identifier (`id`) or by specifying a pattern (`search`). For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -128,11 +127,12 @@ let bearerAuth = defaultClient.authentications['bearerAuth'];
|
||||||
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
||||||
|
|
||||||
let apiInstance = new garage.KeyApi();
|
let apiInstance = new garage.KeyApi();
|
||||||
let accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage
|
|
||||||
let opts = {
|
let opts = {
|
||||||
'showSecretKey': true // Boolean | Wether or not the secret key should be returned in the response
|
'id': GK31c2f218a2e44f485b94239e, // String | The exact API access key generated by Garage. Incompatible with `search`.
|
||||||
|
'search': test-k, // String | A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`.
|
||||||
|
'showSecretKey': true // String | Wether or not the secret key should be returned in the response
|
||||||
};
|
};
|
||||||
apiInstance.getKey(accessKey, opts).then((data) => {
|
apiInstance.getKey(opts).then((data) => {
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data: ' + data);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
@ -145,8 +145,9 @@ apiInstance.getKey(accessKey, opts).then((data) => {
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**accessKey** | **String**| The exact API access key generated by Garage |
|
**id** | **String**| The exact API access key generated by Garage. Incompatible with `search`. | [optional]
|
||||||
**showSecretKey** | **Boolean**| Wether or not the secret key should be returned in the response | [optional] [default to false]
|
**search** | **String**| A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`. | [optional]
|
||||||
|
**showSecretKey** | **String**| Wether or not the secret key should be returned in the response | [optional] [default to 'false']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -254,58 +255,6 @@ This endpoint does not need any parameter.
|
||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
|
||||||
## searchKey
|
|
||||||
|
|
||||||
> KeyInfo searchKey(pattern, opts)
|
|
||||||
|
|
||||||
Select key by pattern
|
|
||||||
|
|
||||||
Find the first key matching the given pattern based on its identifier or friendly name and return its information. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import garage from 'garage_administration_api_v0garage_v0_9_0';
|
|
||||||
let defaultClient = garage.ApiClient.instance;
|
|
||||||
// Configure Bearer access token for authorization: bearerAuth
|
|
||||||
let bearerAuth = defaultClient.authentications['bearerAuth'];
|
|
||||||
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
|
|
||||||
|
|
||||||
let apiInstance = new garage.KeyApi();
|
|
||||||
let pattern = test-k; // String | A pattern (beginning or full string) corresponding to a key identifier or friendly name
|
|
||||||
let opts = {
|
|
||||||
'showSecretKey': true // Boolean | Wether or not the secret key should be returned in the response
|
|
||||||
};
|
|
||||||
apiInstance.searchKey(pattern, opts).then((data) => {
|
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
|
||||||
}, (error) => {
|
|
||||||
console.error(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**pattern** | **String**| A pattern (beginning or full string) corresponding to a key identifier or friendly name |
|
|
||||||
**showSecretKey** | **Boolean**| Wether or not the secret key should be returned in the response | [optional] [default to false]
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**KeyInfo**](KeyInfo.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[bearerAuth](../README.md#bearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
|
|
||||||
## updateKey
|
## updateKey
|
||||||
|
|
||||||
> KeyInfo updateKey(accessKey, updateKeyRequest)
|
> KeyInfo updateKey(accessKey, updateKeyRequest)
|
||||||
|
|
|
@ -136,20 +136,20 @@ export default class BucketApi {
|
||||||
/**
|
/**
|
||||||
* Delete a bucket
|
* Delete a bucket
|
||||||
* Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is not empty. **Warning:** this will delete all aliases associated with the bucket!
|
* Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is not empty. **Warning:** this will delete all aliases associated with the bucket!
|
||||||
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
|
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||||
*/
|
*/
|
||||||
deleteBucketWithHttpInfo(bucketId) {
|
deleteBucketWithHttpInfo(id) {
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'bucketId' is set
|
// verify the required parameter 'id' is set
|
||||||
if (bucketId === undefined || bucketId === null) {
|
if (id === undefined || id === null) {
|
||||||
throw new Error("Missing the required parameter 'bucketId' when calling deleteBucket");
|
throw new Error("Missing the required parameter 'id' when calling deleteBucket");
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
'bucket_id': bucketId
|
|
||||||
};
|
};
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
|
'id': id
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
};
|
};
|
||||||
|
@ -161,7 +161,7 @@ export default class BucketApi {
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/bucket?id={bucket_id}', 'DELETE',
|
'/bucket', 'DELETE',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -170,11 +170,11 @@ export default class BucketApi {
|
||||||
/**
|
/**
|
||||||
* Delete a bucket
|
* Delete a bucket
|
||||||
* Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is not empty. **Warning:** this will delete all aliases associated with the bucket!
|
* Delete a bucket.Deletes a storage bucket. A bucket cannot be deleted if it is not empty. **Warning:** this will delete all aliases associated with the bucket!
|
||||||
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
|
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||||
*/
|
*/
|
||||||
deleteBucket(bucketId) {
|
deleteBucket(id) {
|
||||||
return this.deleteBucketWithHttpInfo(bucketId)
|
return this.deleteBucketWithHttpInfo(id)
|
||||||
.then(function(response_and_data) {
|
.then(function(response_and_data) {
|
||||||
return response_and_data.data;
|
return response_and_data.data;
|
||||||
});
|
});
|
||||||
|
@ -346,22 +346,22 @@ export default class BucketApi {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a bucket
|
* Get a bucket
|
||||||
* Find a bucket by its global alias
|
* Given a bucket identifier (`id`) or a global alias (`alias`), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
|
||||||
* @param {String} alias The exact global alias of one of the existing buckets
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {String} opts.id The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`.
|
||||||
|
* @param {String} opts.alias The exact global alias of one of the existing buckets. Incompatible with `id`.
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
|
||||||
*/
|
*/
|
||||||
findBucketInfoWithHttpInfo(alias) {
|
getBucketInfoWithHttpInfo(opts) {
|
||||||
|
opts = opts || {};
|
||||||
let postBody = null;
|
let postBody = null;
|
||||||
// verify the required parameter 'alias' is set
|
|
||||||
if (alias === undefined || alias === null) {
|
|
||||||
throw new Error("Missing the required parameter 'alias' when calling findBucketInfo");
|
|
||||||
}
|
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
'alias': alias
|
|
||||||
};
|
};
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
|
'id': opts['id'],
|
||||||
|
'alias': opts['alias']
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
};
|
};
|
||||||
|
@ -373,55 +373,7 @@ export default class BucketApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = BucketInfo;
|
let returnType = BucketInfo;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/bucket?globalAlias={alias}', 'GET',
|
'/bucket', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Find a bucket
|
|
||||||
* Find a bucket by its global alias
|
|
||||||
* @param {String} alias The exact global alias of one of the existing buckets
|
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
|
|
||||||
*/
|
|
||||||
findBucketInfo(alias) {
|
|
||||||
return this.findBucketInfoWithHttpInfo(alias)
|
|
||||||
.then(function(response_and_data) {
|
|
||||||
return response_and_data.data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a bucket
|
|
||||||
* Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
|
|
||||||
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
|
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
|
|
||||||
*/
|
|
||||||
getBucketInfoWithHttpInfo(bucketId) {
|
|
||||||
let postBody = null;
|
|
||||||
// verify the required parameter 'bucketId' is set
|
|
||||||
if (bucketId === undefined || bucketId === null) {
|
|
||||||
throw new Error("Missing the required parameter 'bucketId' when calling getBucketInfo");
|
|
||||||
}
|
|
||||||
|
|
||||||
let pathParams = {
|
|
||||||
'bucket_id': bucketId
|
|
||||||
};
|
|
||||||
let queryParams = {
|
|
||||||
};
|
|
||||||
let headerParams = {
|
|
||||||
};
|
|
||||||
let formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
let authNames = ['bearerAuth'];
|
|
||||||
let contentTypes = [];
|
|
||||||
let accepts = ['application/json'];
|
|
||||||
let returnType = BucketInfo;
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/bucket?id={bucket_id}', 'GET',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -429,12 +381,14 @@ export default class BucketApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a bucket
|
* Get a bucket
|
||||||
* Given a bucket identifier, get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
|
* Given a bucket identifier (`id`) or a global alias (`alias`), get its information. It includes its aliases, its web configuration, keys that have some permissions on it, some statistics (number of objects, size), number of dangling multipart uploads, and its quotas (if any).
|
||||||
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
|
* @param {Object} opts Optional parameters
|
||||||
|
* @param {String} opts.id The exact bucket identifier, a 32 bytes hexadecimal string. Incompatible with `alias`.
|
||||||
|
* @param {String} opts.alias The exact global alias of one of the existing buckets. Incompatible with `id`.
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
|
||||||
*/
|
*/
|
||||||
getBucketInfo(bucketId) {
|
getBucketInfo(opts) {
|
||||||
return this.getBucketInfoWithHttpInfo(bucketId)
|
return this.getBucketInfoWithHttpInfo(opts)
|
||||||
.then(function(response_and_data) {
|
.then(function(response_and_data) {
|
||||||
return response_and_data.data;
|
return response_and_data.data;
|
||||||
});
|
});
|
||||||
|
@ -463,7 +417,7 @@ export default class BucketApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = [ListBuckets200ResponseInner];
|
let returnType = [ListBuckets200ResponseInner];
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/bucket', 'GET',
|
'/bucket?list', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -602,15 +556,15 @@ export default class BucketApi {
|
||||||
/**
|
/**
|
||||||
* Update a bucket
|
* Update a bucket
|
||||||
* All fields (`websiteAccess` and `quotas`) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
|
* All fields (`websiteAccess` and `quotas`) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
|
||||||
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
|
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
|
||||||
* @param {module:model/UpdateBucketRequest} updateBucketRequest Requested changes on the bucket. Both root fields are optionals.
|
* @param {module:model/UpdateBucketRequest} updateBucketRequest Requested changes on the bucket. Both root fields are optionals.
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
|
||||||
*/
|
*/
|
||||||
updateBucketWithHttpInfo(bucketId, updateBucketRequest) {
|
updateBucketWithHttpInfo(id, updateBucketRequest) {
|
||||||
let postBody = updateBucketRequest;
|
let postBody = updateBucketRequest;
|
||||||
// verify the required parameter 'bucketId' is set
|
// verify the required parameter 'id' is set
|
||||||
if (bucketId === undefined || bucketId === null) {
|
if (id === undefined || id === null) {
|
||||||
throw new Error("Missing the required parameter 'bucketId' when calling updateBucket");
|
throw new Error("Missing the required parameter 'id' when calling updateBucket");
|
||||||
}
|
}
|
||||||
// verify the required parameter 'updateBucketRequest' is set
|
// verify the required parameter 'updateBucketRequest' is set
|
||||||
if (updateBucketRequest === undefined || updateBucketRequest === null) {
|
if (updateBucketRequest === undefined || updateBucketRequest === null) {
|
||||||
|
@ -618,9 +572,9 @@ export default class BucketApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
'bucket_id': bucketId
|
|
||||||
};
|
};
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
|
'id': id
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
};
|
};
|
||||||
|
@ -632,7 +586,7 @@ export default class BucketApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = BucketInfo;
|
let returnType = BucketInfo;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/bucket?id={bucket_id}', 'PUT',
|
'/bucket', 'PUT',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -641,12 +595,12 @@ export default class BucketApi {
|
||||||
/**
|
/**
|
||||||
* Update a bucket
|
* Update a bucket
|
||||||
* All fields (`websiteAccess` and `quotas`) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
|
* All fields (`websiteAccess` and `quotas`) are optional. If they are present, the corresponding modifications are applied to the bucket, otherwise nothing is changed. In `websiteAccess`: if `enabled` is `true`, `indexDocument` must be specified. The field `errorDocument` is optional, if no error document is set a generic error message is displayed when errors happen. Conversely, if `enabled` is `false`, neither `indexDocument` nor `errorDocument` must be specified. In `quotas`: new values of `maxSize` and `maxObjects` must both be specified, or set to `null` to remove the quotas. An absent value will be considered the same as a `null`. It is not possible to change only one of the two quotas.
|
||||||
* @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string
|
* @param {String} id The exact bucket identifier, a 32 bytes hexadecimal string
|
||||||
* @param {module:model/UpdateBucketRequest} updateBucketRequest Requested changes on the bucket. Both root fields are optionals.
|
* @param {module:model/UpdateBucketRequest} updateBucketRequest Requested changes on the bucket. Both root fields are optionals.
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
|
||||||
*/
|
*/
|
||||||
updateBucket(bucketId, updateBucketRequest) {
|
updateBucket(id, updateBucketRequest) {
|
||||||
return this.updateBucketWithHttpInfo(bucketId, updateBucketRequest)
|
return this.updateBucketWithHttpInfo(id, updateBucketRequest)
|
||||||
.then(function(response_and_data) {
|
.then(function(response_and_data) {
|
||||||
return response_and_data.data;
|
return response_and_data.data;
|
||||||
});
|
});
|
||||||
|
|
|
@ -66,7 +66,7 @@ export default class KeyApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = KeyInfo;
|
let returnType = KeyInfo;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/key', 'POST',
|
'/key?list', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -114,7 +114,7 @@ export default class KeyApi {
|
||||||
let accepts = [];
|
let accepts = [];
|
||||||
let returnType = null;
|
let returnType = null;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/key?id={access_key}', 'DELETE',
|
'/key', 'DELETE',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -136,24 +136,22 @@ export default class KeyApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get key information
|
* Get key information
|
||||||
* Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
* Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. You can search by specifying the exact key identifier (`id`) or by specifying a pattern (`search`). For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
||||||
* @param {String} accessKey The exact API access key generated by Garage
|
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {Boolean} opts.showSecretKey Wether or not the secret key should be returned in the response (default to false)
|
* @param {String} opts.id The exact API access key generated by Garage. Incompatible with `search`.
|
||||||
|
* @param {String} opts.search A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`.
|
||||||
|
* @param {module:model/String} opts.showSecretKey Wether or not the secret key should be returned in the response (default to 'false')
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/KeyInfo} and HTTP response
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/KeyInfo} and HTTP response
|
||||||
*/
|
*/
|
||||||
getKeyWithHttpInfo(accessKey, opts) {
|
getKeyWithHttpInfo(opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
let postBody = null;
|
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 getKey");
|
|
||||||
}
|
|
||||||
|
|
||||||
let pathParams = {
|
let pathParams = {
|
||||||
'access_key': accessKey
|
|
||||||
};
|
};
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
|
'id': opts['id'],
|
||||||
|
'search': opts['search'],
|
||||||
'showSecretKey': opts['showSecretKey']
|
'showSecretKey': opts['showSecretKey']
|
||||||
};
|
};
|
||||||
let headerParams = {
|
let headerParams = {
|
||||||
|
@ -166,7 +164,7 @@ export default class KeyApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = KeyInfo;
|
let returnType = KeyInfo;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/key?id={access_key}', 'GET',
|
'/key', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -174,14 +172,15 @@ export default class KeyApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get key information
|
* Get key information
|
||||||
* Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
* Return information about a specific key like its identifiers, its permissions and buckets on which it has permissions. You can search by specifying the exact key identifier (`id`) or by specifying a pattern (`search`). For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
||||||
* @param {String} accessKey The exact API access key generated by Garage
|
|
||||||
* @param {Object} opts Optional parameters
|
* @param {Object} opts Optional parameters
|
||||||
* @param {Boolean} opts.showSecretKey Wether or not the secret key should be returned in the response (default to false)
|
* @param {String} opts.id The exact API access key generated by Garage. Incompatible with `search`.
|
||||||
|
* @param {String} opts.search A pattern (beginning or full string) corresponding to a key identifier or friendly name. Incompatible with `id`.
|
||||||
|
* @param {module:model/String} opts.showSecretKey Wether or not the secret key should be returned in the response (default to 'false')
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/KeyInfo}
|
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/KeyInfo}
|
||||||
*/
|
*/
|
||||||
getKey(accessKey, opts) {
|
getKey(opts) {
|
||||||
return this.getKeyWithHttpInfo(accessKey, opts)
|
return this.getKeyWithHttpInfo(opts)
|
||||||
.then(function(response_and_data) {
|
.then(function(response_and_data) {
|
||||||
return response_and_data.data;
|
return response_and_data.data;
|
||||||
});
|
});
|
||||||
|
@ -257,7 +256,7 @@ export default class KeyApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = [ListKeys200ResponseInner];
|
let returnType = [ListKeys200ResponseInner];
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/key', 'GET',
|
'/key?list', 'GET',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
@ -276,60 +275,6 @@ export default class KeyApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Select key by pattern
|
|
||||||
* Find the first key matching the given pattern based on its identifier or friendly name and return its information. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
|
||||||
* @param {String} pattern A pattern (beginning or full string) corresponding to a key identifier or friendly name
|
|
||||||
* @param {Object} opts Optional parameters
|
|
||||||
* @param {Boolean} opts.showSecretKey Wether or not the secret key should be returned in the response (default to false)
|
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/KeyInfo} and HTTP response
|
|
||||||
*/
|
|
||||||
searchKeyWithHttpInfo(pattern, opts) {
|
|
||||||
opts = opts || {};
|
|
||||||
let postBody = null;
|
|
||||||
// verify the required parameter 'pattern' is set
|
|
||||||
if (pattern === undefined || pattern === null) {
|
|
||||||
throw new Error("Missing the required parameter 'pattern' when calling searchKey");
|
|
||||||
}
|
|
||||||
|
|
||||||
let pathParams = {
|
|
||||||
'pattern': pattern
|
|
||||||
};
|
|
||||||
let queryParams = {
|
|
||||||
'showSecretKey': opts['showSecretKey']
|
|
||||||
};
|
|
||||||
let headerParams = {
|
|
||||||
};
|
|
||||||
let formParams = {
|
|
||||||
};
|
|
||||||
|
|
||||||
let authNames = ['bearerAuth'];
|
|
||||||
let contentTypes = [];
|
|
||||||
let accepts = ['application/json'];
|
|
||||||
let returnType = KeyInfo;
|
|
||||||
return this.apiClient.callApi(
|
|
||||||
'/key?search={pattern}', 'GET',
|
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
|
||||||
authNames, contentTypes, accepts, returnType, null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Select key by pattern
|
|
||||||
* Find the first key matching the given pattern based on its identifier or friendly name and return its information. For confidentiality reasons, the secret key is not returned by default: you must pass the `showSecretKey` query parameter to get it.
|
|
||||||
* @param {String} pattern A pattern (beginning or full string) corresponding to a key identifier or friendly name
|
|
||||||
* @param {Object} opts Optional parameters
|
|
||||||
* @param {Boolean} opts.showSecretKey Wether or not the secret key should be returned in the response (default to false)
|
|
||||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/KeyInfo}
|
|
||||||
*/
|
|
||||||
searchKey(pattern, opts) {
|
|
||||||
return this.searchKeyWithHttpInfo(pattern, opts)
|
|
||||||
.then(function(response_and_data) {
|
|
||||||
return response_and_data.data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a key
|
* 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.*
|
* Updates information about the specified API access key. *Note: the secret key is not returned in the response, `null` is sent instead.*
|
||||||
|
@ -363,7 +308,7 @@ export default class KeyApi {
|
||||||
let accepts = ['application/json'];
|
let accepts = ['application/json'];
|
||||||
let returnType = KeyInfo;
|
let returnType = KeyInfo;
|
||||||
return this.apiClient.callApi(
|
return this.apiClient.callApi(
|
||||||
'/key?id={access_key}', 'POST',
|
'/key', 'POST',
|
||||||
pathParams, queryParams, headerParams, formParams, postBody,
|
pathParams, queryParams, headerParams, formParams, postBody,
|
||||||
authNames, contentTypes, accepts, returnType, null
|
authNames, contentTypes, accepts, returnType, null
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue