2022-11-13 11:28:54 +00:00
/ * *
2023-11-22 17:30:42 +00:00
* Garage Administration API v0 + garage - v0 . 9.0
2022-11-13 11:28:54 +00:00
* Administrate your Garage cluster programatically , including status , layout , keys , buckets , and maintainance tasks . * Disclaimer : The API is not stable yet , hence its v0 tag . The API can change at any time , and changes can include breaking backward compatibility . Read the changelog and upgrade your scripts before upgrading . Additionnaly , this specification is very early stage and can contain bugs , especially on error return codes / types that are not tested yet . Do not expect a well finished and polished product ! *
*
2023-11-22 17:30:42 +00:00
* The version of the OpenAPI document : v0 . 9.0
2022-11-13 11:28:54 +00:00
*
*
* NOTE : This class is auto generated by OpenAPI Generator ( https : //openapi-generator.tech).
* https : //openapi-generator.tech
* Do not edit the class manually .
*
* /
import ApiClient from "../ApiClient" ;
import AllowBucketKeyRequest from '../model/AllowBucketKeyRequest' ;
import BucketInfo from '../model/BucketInfo' ;
import CreateBucketRequest from '../model/CreateBucketRequest' ;
import ListBuckets200ResponseInner from '../model/ListBuckets200ResponseInner' ;
import UpdateBucketRequest from '../model/UpdateBucketRequest' ;
/ * *
* Bucket service .
* @ module api / BucketApi
2023-11-22 17:30:42 +00:00
* @ version v0 . 9.0
2022-11-13 11:28:54 +00:00
* /
export default class BucketApi {
/ * *
* Constructs a new BucketApi .
* @ alias module : api / BucketApi
* @ class
* @ param { module : ApiClient } [ apiClient ] Optional API client implementation to use ,
* default to { @ link module : ApiClient # instance } if unspecified .
* /
constructor ( apiClient ) {
this . apiClient = apiClient || ApiClient . instance ;
}
/ * *
* Allow key
* ⚠ ️ * * DISCLAIMER * * : Garage ' s developers are aware that this endpoint has an unconventional semantic . Be extra careful when implementing it , its behavior is not obvious . Allows a key to do read / write / owner operations on a bucket . Flags in permissions which have the value true will be activated . Other flags will remain unchanged ( ie . they will keep their internal value ) . For example , if you set read to true , the key will be allowed to read the bucket . If you set it to false , the key will keeps its previous read permission . If you want to disallow read for the key , check the DenyBucketKey operation .
* @ param { module : model / AllowBucketKeyRequest } allowBucketKeyRequest Aliases to put on the new bucket
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
allowBucketKeyWithHttpInfo ( allowBucketKeyRequest ) {
2022-11-13 11:28:54 +00:00
let postBody = allowBucketKeyRequest ;
// verify the required parameter 'allowBucketKeyRequest' is set
if ( allowBucketKeyRequest === undefined || allowBucketKeyRequest === null ) {
throw new Error ( "Missing the required parameter 'allowBucketKeyRequest' when calling allowBucketKey" ) ;
}
let pathParams = {
} ;
let queryParams = {
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ 'application/json' ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket/allow' , 'POST' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Allow key
* ⚠ ️ * * DISCLAIMER * * : Garage ' s developers are aware that this endpoint has an unconventional semantic . Be extra careful when implementing it , its behavior is not obvious . Allows a key to do read / write / owner operations on a bucket . Flags in permissions which have the value true will be activated . Other flags will remain unchanged ( ie . they will keep their internal value ) . For example , if you set read to true , the key will be allowed to read the bucket . If you set it to false , the key will keeps its previous read permission . If you want to disallow read for the key , check the DenyBucketKey operation .
* @ param { module : model / AllowBucketKeyRequest } allowBucketKeyRequest Aliases to put on the new bucket
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
allowBucketKey ( allowBucketKeyRequest ) {
return this . allowBucketKeyWithHttpInfo ( allowBucketKeyRequest )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Create a bucket
* Creates a new bucket , either with a global alias , a local one , or no alias at all . Technically , you can also specify both ` globalAlias ` and ` localAlias ` and that would create two aliases .
* @ param { module : model / CreateBucketRequest } createBucketRequest Aliases to put on the new bucket
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
createBucketWithHttpInfo ( createBucketRequest ) {
2022-11-13 11:28:54 +00:00
let postBody = createBucketRequest ;
// verify the required parameter 'createBucketRequest' is set
if ( createBucketRequest === undefined || createBucketRequest === null ) {
throw new Error ( "Missing the required parameter 'createBucketRequest' when calling createBucket" ) ;
}
let pathParams = {
} ;
let queryParams = {
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ 'application/json' ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket' , 'POST' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Create a bucket
* Creates a new bucket , either with a global alias , a local one , or no alias at all . Technically , you can also specify both ` globalAlias ` and ` localAlias ` and that would create two aliases .
* @ param { module : model / CreateBucketRequest } createBucketRequest Aliases to put on the new bucket
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
createBucket ( createBucketRequest ) {
return this . createBucketWithHttpInfo ( createBucketRequest )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* 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 !
2023-11-22 20:18:18 +00:00
* @ param { String } id The exact bucket identifier , a 32 bytes hexadecimal string
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing HTTP response
2022-11-13 11:28:54 +00:00
* /
2023-11-22 20:18:18 +00:00
deleteBucketWithHttpInfo ( id ) {
2022-11-13 11:28:54 +00:00
let postBody = null ;
2023-11-22 20:18:18 +00:00
// verify the required parameter 'id' is set
if ( id === undefined || id === null ) {
throw new Error ( "Missing the required parameter 'id' when calling deleteBucket" ) ;
2022-11-13 11:28:54 +00:00
}
let pathParams = {
} ;
let queryParams = {
2023-11-22 20:18:18 +00:00
'id' : id
2022-11-13 11:28:54 +00:00
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ ] ;
let returnType = null ;
return this . apiClient . callApi (
2023-11-22 20:18:18 +00:00
'/bucket' , 'DELETE' ,
2022-11-13 11:28:54 +00:00
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* 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 !
2023-11-22 20:18:18 +00:00
* @ param { String } id The exact bucket identifier , a 32 bytes hexadecimal string
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}
2022-11-13 11:28:54 +00:00
* /
2023-11-22 20:18:18 +00:00
deleteBucket ( id ) {
return this . deleteBucketWithHttpInfo ( id )
2022-11-13 11:56:24 +00:00
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Delete a global alias
* Delete a global alias from the target bucket
* @ param { String } id
* @ param { String } alias
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
deleteBucketGlobalAliasWithHttpInfo ( id , alias ) {
2022-11-13 11:28:54 +00:00
let postBody = null ;
// verify the required parameter 'id' is set
if ( id === undefined || id === null ) {
throw new Error ( "Missing the required parameter 'id' when calling deleteBucketGlobalAlias" ) ;
}
// verify the required parameter 'alias' is set
if ( alias === undefined || alias === null ) {
throw new Error ( "Missing the required parameter 'alias' when calling deleteBucketGlobalAlias" ) ;
}
let pathParams = {
} ;
let queryParams = {
'id' : id ,
'alias' : alias
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket/alias/global' , 'DELETE' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Delete a global alias
* Delete a global alias from the target bucket
* @ param { String } id
* @ param { String } alias
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
deleteBucketGlobalAlias ( id , alias ) {
return this . deleteBucketGlobalAliasWithHttpInfo ( id , alias )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Delete a local alias
* Delete a local alias , bound to specified account , from the target bucket
* @ param { String } id
* @ param { String } accessKeyId
* @ param { String } alias
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
deleteBucketLocalAliasWithHttpInfo ( id , accessKeyId , alias ) {
2022-11-13 11:28:54 +00:00
let postBody = null ;
// verify the required parameter 'id' is set
if ( id === undefined || id === null ) {
throw new Error ( "Missing the required parameter 'id' when calling deleteBucketLocalAlias" ) ;
}
// verify the required parameter 'accessKeyId' is set
if ( accessKeyId === undefined || accessKeyId === null ) {
throw new Error ( "Missing the required parameter 'accessKeyId' when calling deleteBucketLocalAlias" ) ;
}
// verify the required parameter 'alias' is set
if ( alias === undefined || alias === null ) {
throw new Error ( "Missing the required parameter 'alias' when calling deleteBucketLocalAlias" ) ;
}
let pathParams = {
} ;
let queryParams = {
'id' : id ,
'accessKeyId' : accessKeyId ,
'alias' : alias
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket/alias/local' , 'DELETE' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Delete a local alias
* Delete a local alias , bound to specified account , from the target bucket
* @ param { String } id
* @ param { String } accessKeyId
* @ param { String } alias
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
deleteBucketLocalAlias ( id , accessKeyId , alias ) {
return this . deleteBucketLocalAliasWithHttpInfo ( id , accessKeyId , alias )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Deny key
* ⚠ ️ * * DISCLAIMER * * : Garage ' s developers are aware that this endpoint has an unconventional semantic . Be extra careful when implementing it , its behavior is not obvious . Denies a key from doing read / write / owner operations on a bucket . Flags in permissions which have the value true will be deactivated . Other flags will remain unchanged . For example , if you set read to true , the key will be denied from reading . If you set read to false , the key will keep its previous permissions . If you want the key to have the reading permission , check the AllowBucketKey operation .
* @ param { module : model / AllowBucketKeyRequest } allowBucketKeyRequest Aliases to put on the new bucket
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
denyBucketKeyWithHttpInfo ( allowBucketKeyRequest ) {
2022-11-13 11:28:54 +00:00
let postBody = allowBucketKeyRequest ;
// verify the required parameter 'allowBucketKeyRequest' is set
if ( allowBucketKeyRequest === undefined || allowBucketKeyRequest === null ) {
throw new Error ( "Missing the required parameter 'allowBucketKeyRequest' when calling denyBucketKey" ) ;
}
let pathParams = {
} ;
let queryParams = {
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ 'application/json' ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket/deny' , 'POST' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Deny key
* ⚠ ️ * * DISCLAIMER * * : Garage ' s developers are aware that this endpoint has an unconventional semantic . Be extra careful when implementing it , its behavior is not obvious . Denies a key from doing read / write / owner operations on a bucket . Flags in permissions which have the value true will be deactivated . Other flags will remain unchanged . For example , if you set read to true , the key will be denied from reading . If you set read to false , the key will keep its previous permissions . If you want the key to have the reading permission , check the AllowBucketKey operation .
* @ param { module : model / AllowBucketKeyRequest } allowBucketKeyRequest Aliases to put on the new bucket
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
denyBucketKey ( allowBucketKeyRequest ) {
return this . denyBucketKeyWithHttpInfo ( allowBucketKeyRequest )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Get a bucket
2023-11-22 20:18:18 +00:00
* 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 { 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 ` .
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2023-11-22 20:18:18 +00:00
getBucketInfoWithHttpInfo ( opts ) {
opts = opts || { } ;
2022-11-13 11:28:54 +00:00
let postBody = null ;
let pathParams = {
} ;
let queryParams = {
2023-11-22 20:18:18 +00:00
'id' : opts [ 'id' ] ,
'alias' : opts [ 'alias' ]
2022-11-13 11:28:54 +00:00
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
2023-11-22 20:18:18 +00:00
'/bucket' , 'GET' ,
2022-11-13 11:28:54 +00:00
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Get a bucket
2023-11-22 20:18:18 +00:00
* 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 { 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 ` .
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2023-11-22 20:18:18 +00:00
getBucketInfo ( opts ) {
return this . getBucketInfoWithHttpInfo ( opts )
2022-11-13 11:56:24 +00:00
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* List all buckets
* List all the buckets on the cluster with their UUID and their global and local aliases .
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/ListBuckets200ResponseInner>} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
listBucketsWithHttpInfo ( ) {
2022-11-13 11:28:54 +00:00
let postBody = null ;
let pathParams = {
} ;
let queryParams = {
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ 'application/json' ] ;
let returnType = [ ListBuckets200ResponseInner ] ;
return this . apiClient . callApi (
2023-11-22 20:18:18 +00:00
'/bucket?list' , 'GET' ,
2022-11-13 11:28:54 +00:00
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* List all buckets
* List all the buckets on the cluster with their UUID and their global and local aliases .
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/ListBuckets200ResponseInner>}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
listBuckets ( ) {
return this . listBucketsWithHttpInfo ( )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Add a global alias
* Add a global alias to the target bucket
* @ param { String } id
* @ param { String } alias
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
putBucketGlobalAliasWithHttpInfo ( id , alias ) {
2022-11-13 11:28:54 +00:00
let postBody = null ;
// verify the required parameter 'id' is set
if ( id === undefined || id === null ) {
throw new Error ( "Missing the required parameter 'id' when calling putBucketGlobalAlias" ) ;
}
// verify the required parameter 'alias' is set
if ( alias === undefined || alias === null ) {
throw new Error ( "Missing the required parameter 'alias' when calling putBucketGlobalAlias" ) ;
}
let pathParams = {
} ;
let queryParams = {
'id' : id ,
'alias' : alias
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket/alias/global' , 'PUT' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Add a global alias
* Add a global alias to the target bucket
* @ param { String } id
* @ param { String } alias
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
putBucketGlobalAlias ( id , alias ) {
return this . putBucketGlobalAliasWithHttpInfo ( id , alias )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Add a local alias
* Add a local alias , bound to specified account , to the target bucket
* @ param { String } id
* @ param { String } accessKeyId
* @ param { String } alias
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
putBucketLocalAliasWithHttpInfo ( id , accessKeyId , alias ) {
2022-11-13 11:28:54 +00:00
let postBody = null ;
// verify the required parameter 'id' is set
if ( id === undefined || id === null ) {
throw new Error ( "Missing the required parameter 'id' when calling putBucketLocalAlias" ) ;
}
// verify the required parameter 'accessKeyId' is set
if ( accessKeyId === undefined || accessKeyId === null ) {
throw new Error ( "Missing the required parameter 'accessKeyId' when calling putBucketLocalAlias" ) ;
}
// verify the required parameter 'alias' is set
if ( alias === undefined || alias === null ) {
throw new Error ( "Missing the required parameter 'alias' when calling putBucketLocalAlias" ) ;
}
let pathParams = {
} ;
let queryParams = {
'id' : id ,
'accessKeyId' : accessKeyId ,
'alias' : alias
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
'/bucket/alias/local' , 'PUT' ,
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
/ * *
2022-11-13 11:56:24 +00:00
* Add a local alias
* Add a local alias , bound to specified account , to the target bucket
* @ param { String } id
* @ param { String } accessKeyId
* @ param { String } alias
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with data of type {@link module:model/BucketInfo}
2022-11-13 11:28:54 +00:00
* /
2022-11-13 11:56:24 +00:00
putBucketLocalAlias ( id , accessKeyId , alias ) {
return this . putBucketLocalAliasWithHttpInfo ( id , accessKeyId , alias )
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
/ * *
* Update a bucket
2023-11-22 17:30:42 +00:00
* 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 .
2023-11-22 20:18:18 +00:00
* @ param { String } id The exact bucket identifier , a 32 bytes hexadecimal string
2022-11-13 11:28:54 +00:00
* @ param { module : model / UpdateBucketRequest } updateBucketRequest Requested changes on the bucket . Both root fields are optionals .
2022-11-13 11:56:24 +00:00
* @ return { Promise } a { @ link https : //www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BucketInfo} and HTTP response
2022-11-13 11:28:54 +00:00
* /
2023-11-22 20:18:18 +00:00
updateBucketWithHttpInfo ( id , updateBucketRequest ) {
2022-11-13 11:28:54 +00:00
let postBody = updateBucketRequest ;
2023-11-22 20:18:18 +00:00
// verify the required parameter 'id' is set
if ( id === undefined || id === null ) {
throw new Error ( "Missing the required parameter 'id' when calling updateBucket" ) ;
2022-11-13 11:28:54 +00:00
}
// verify the required parameter 'updateBucketRequest' is set
if ( updateBucketRequest === undefined || updateBucketRequest === null ) {
throw new Error ( "Missing the required parameter 'updateBucketRequest' when calling updateBucket" ) ;
}
let pathParams = {
} ;
let queryParams = {
2023-11-22 20:18:18 +00:00
'id' : id
2022-11-13 11:28:54 +00:00
} ;
let headerParams = {
} ;
let formParams = {
} ;
let authNames = [ 'bearerAuth' ] ;
let contentTypes = [ 'application/json' ] ;
let accepts = [ 'application/json' ] ;
let returnType = BucketInfo ;
return this . apiClient . callApi (
2023-11-22 20:18:18 +00:00
'/bucket' , 'PUT' ,
2022-11-13 11:28:54 +00:00
pathParams , queryParams , headerParams , formParams , postBody ,
2022-11-13 11:56:24 +00:00
authNames , contentTypes , accepts , returnType , null
2022-11-13 11:28:54 +00:00
) ;
}
2022-11-13 11:56:24 +00:00
/ * *
* Update a bucket
2023-11-22 17:30:42 +00:00
* 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 .
2023-11-22 20:18:18 +00:00
* @ param { String } id The exact bucket identifier , a 32 bytes hexadecimal string
2022-11-13 11:56:24 +00:00
* @ 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}
* /
2023-11-22 20:18:18 +00:00
updateBucket ( id , updateBucketRequest ) {
return this . updateBucketWithHttpInfo ( id , updateBucketRequest )
2022-11-13 11:56:24 +00:00
. then ( function ( response _and _data ) {
return response _and _data . data ;
} ) ;
}
2022-11-13 11:28:54 +00:00
}