From 10360d3b3c5596abc668ff95d6924f1dd6485509 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sun, 13 Nov 2022 12:28:54 +0100 Subject: [PATCH] Initial commit --- .babelrc | 33 + .gitignore | 130 ++++ .openapi-generator-ignore | 23 + .openapi-generator/FILES | 112 +++ .openapi-generator/VERSION | 1 + .travis.yml | 5 + README.md | 198 +++++ docs/AddKeyRequest.md | 9 + docs/AddNode200ResponseInner.md | 10 + docs/AllowBucketKeyRequest.md | 11 + docs/AllowBucketKeyRequestPermissions.md | 11 + docs/BucketApi.md | 618 ++++++++++++++++ docs/BucketInfo.md | 17 + docs/BucketInfoQuotas.md | 10 + docs/BucketInfoWebsiteConfig.md | 10 + docs/BucketKeyInfo.md | 12 + docs/ClusterLayout.md | 11 + docs/CreateBucketRequest.md | 10 + docs/CreateBucketRequestLocalAlias.md | 11 + docs/CreateBucketRequestLocalAliasAllow.md | 11 + docs/GetNodes200Response.md | 12 + docs/ImportKeyRequest.md | 11 + docs/KeyApi.md | 356 +++++++++ docs/KeyInfo.md | 13 + docs/KeyInfoBucketsInner.md | 12 + docs/KeyInfoBucketsInnerPermissions.md | 11 + docs/KeyInfoPermissions.md | 9 + docs/LayoutApi.md | 204 ++++++ docs/LayoutVersion.md | 9 + docs/ListBuckets200ResponseInner.md | 11 + ...uckets200ResponseInnerLocalAliasesInner.md | 10 + docs/ListKeys200ResponseInner.md | 10 + docs/NodeClusterInfo.md | 11 + docs/NodeNetworkInfo.md | 12 + docs/NodesApi.md | 104 +++ docs/UpdateBucketRequest.md | 10 + docs/UpdateBucketRequestQuotas.md | 10 + docs/UpdateBucketRequestWebsiteAccess.md | 11 + docs/UpdateKeyRequest.md | 11 + docs/UpdateKeyRequestAllow.md | 9 + docs/UpdateKeyRequestDeny.md | 9 + git_push.sh | 57 ++ mocha.opts | 1 + package.json | 46 ++ src/ApiClient.js | 692 ++++++++++++++++++ src/api/BucketApi.js | 589 +++++++++++++++ src/api/KeyApi.js | 339 +++++++++ src/api/LayoutApi.js | 200 +++++ src/api/NodesApi.js | 118 +++ src/index.js | 293 ++++++++ src/model/AddKeyRequest.js | 71 ++ src/model/AddNode200ResponseInner.js | 79 ++ src/model/AllowBucketKeyRequest.js | 94 +++ src/model/AllowBucketKeyRequestPermissions.js | 93 +++ src/model/BucketInfo.js | 138 ++++ src/model/BucketInfoQuotas.js | 79 ++ src/model/BucketInfoWebsiteConfig.js | 79 ++ src/model/BucketKeyInfo.js | 96 +++ src/model/ClusterLayout.js | 94 +++ src/model/CreateBucketRequest.js | 80 ++ src/model/CreateBucketRequestLocalAlias.js | 88 +++ .../CreateBucketRequestLocalAliasAllow.js | 87 +++ src/model/GetNodes200Response.js | 105 +++ src/model/ImportKeyRequest.js | 93 +++ src/model/KeyInfo.js | 105 +++ src/model/KeyInfoBucketsInner.js | 96 +++ src/model/KeyInfoBucketsInnerPermissions.js | 87 +++ src/model/KeyInfoPermissions.js | 71 ++ src/model/LayoutVersion.js | 71 ++ src/model/ListBuckets200ResponseInner.js | 90 +++ ...uckets200ResponseInnerLocalAliasesInner.js | 83 +++ src/model/ListKeys200ResponseInner.js | 81 ++ src/model/NodeClusterInfo.js | 94 +++ src/model/NodeNetworkInfo.js | 103 +++ src/model/UpdateBucketRequest.js | 81 ++ src/model/UpdateBucketRequestQuotas.js | 79 ++ src/model/UpdateBucketRequestWebsiteAccess.js | 87 +++ src/model/UpdateKeyRequest.js | 89 +++ src/model/UpdateKeyRequestAllow.js | 71 ++ src/model/UpdateKeyRequestDeny.js | 71 ++ test/api/BucketApi.spec.js | 173 +++++ test/api/KeyApi.spec.js | 123 ++++ test/api/LayoutApi.spec.js | 93 +++ test/api/NodesApi.spec.js | 73 ++ test/model/AddKeyRequest.spec.js | 65 ++ test/model/AddNode200ResponseInner.spec.js | 71 ++ test/model/AllowBucketKeyRequest.spec.js | 77 ++ .../AllowBucketKeyRequestPermissions.spec.js | 77 ++ test/model/BucketInfo.spec.js | 113 +++ test/model/BucketInfoQuotas.spec.js | 71 ++ test/model/BucketInfoWebsiteConfig.spec.js | 71 ++ test/model/BucketKeyInfo.spec.js | 83 +++ test/model/ClusterLayout.spec.js | 77 ++ test/model/CreateBucketRequest.spec.js | 71 ++ .../CreateBucketRequestLocalAlias.spec.js | 77 ++ ...CreateBucketRequestLocalAliasAllow.spec.js | 77 ++ test/model/GetNodes200Response.spec.js | 83 +++ test/model/ImportKeyRequest.spec.js | 77 ++ test/model/KeyInfo.spec.js | 89 +++ test/model/KeyInfoBucketsInner.spec.js | 83 +++ .../KeyInfoBucketsInnerPermissions.spec.js | 77 ++ test/model/KeyInfoPermissions.spec.js | 65 ++ test/model/LayoutVersion.spec.js | 65 ++ .../model/ListBuckets200ResponseInner.spec.js | 77 ++ ...s200ResponseInnerLocalAliasesInner.spec.js | 71 ++ test/model/ListKeys200ResponseInner.spec.js | 71 ++ test/model/NodeClusterInfo.spec.js | 77 ++ test/model/NodeNetworkInfo.spec.js | 83 +++ test/model/UpdateBucketRequest.spec.js | 71 ++ test/model/UpdateBucketRequestQuotas.spec.js | 71 ++ .../UpdateBucketRequestWebsiteAccess.spec.js | 77 ++ test/model/UpdateKeyRequest.spec.js | 77 ++ test/model/UpdateKeyRequestAllow.spec.js | 65 ++ test/model/UpdateKeyRequestDeny.spec.js | 65 ++ 114 files changed, 9814 insertions(+) create mode 100644 .babelrc create mode 100644 .gitignore create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 .travis.yml create mode 100644 README.md create mode 100644 docs/AddKeyRequest.md create mode 100644 docs/AddNode200ResponseInner.md create mode 100644 docs/AllowBucketKeyRequest.md create mode 100644 docs/AllowBucketKeyRequestPermissions.md create mode 100644 docs/BucketApi.md create mode 100644 docs/BucketInfo.md create mode 100644 docs/BucketInfoQuotas.md create mode 100644 docs/BucketInfoWebsiteConfig.md create mode 100644 docs/BucketKeyInfo.md create mode 100644 docs/ClusterLayout.md create mode 100644 docs/CreateBucketRequest.md create mode 100644 docs/CreateBucketRequestLocalAlias.md create mode 100644 docs/CreateBucketRequestLocalAliasAllow.md create mode 100644 docs/GetNodes200Response.md create mode 100644 docs/ImportKeyRequest.md create mode 100644 docs/KeyApi.md create mode 100644 docs/KeyInfo.md create mode 100644 docs/KeyInfoBucketsInner.md create mode 100644 docs/KeyInfoBucketsInnerPermissions.md create mode 100644 docs/KeyInfoPermissions.md create mode 100644 docs/LayoutApi.md create mode 100644 docs/LayoutVersion.md create mode 100644 docs/ListBuckets200ResponseInner.md create mode 100644 docs/ListBuckets200ResponseInnerLocalAliasesInner.md create mode 100644 docs/ListKeys200ResponseInner.md create mode 100644 docs/NodeClusterInfo.md create mode 100644 docs/NodeNetworkInfo.md create mode 100644 docs/NodesApi.md create mode 100644 docs/UpdateBucketRequest.md create mode 100644 docs/UpdateBucketRequestQuotas.md create mode 100644 docs/UpdateBucketRequestWebsiteAccess.md create mode 100644 docs/UpdateKeyRequest.md create mode 100644 docs/UpdateKeyRequestAllow.md create mode 100644 docs/UpdateKeyRequestDeny.md create mode 100644 git_push.sh create mode 100644 mocha.opts create mode 100644 package.json create mode 100644 src/ApiClient.js create mode 100644 src/api/BucketApi.js create mode 100644 src/api/KeyApi.js create mode 100644 src/api/LayoutApi.js create mode 100644 src/api/NodesApi.js create mode 100644 src/index.js create mode 100644 src/model/AddKeyRequest.js create mode 100644 src/model/AddNode200ResponseInner.js create mode 100644 src/model/AllowBucketKeyRequest.js create mode 100644 src/model/AllowBucketKeyRequestPermissions.js create mode 100644 src/model/BucketInfo.js create mode 100644 src/model/BucketInfoQuotas.js create mode 100644 src/model/BucketInfoWebsiteConfig.js create mode 100644 src/model/BucketKeyInfo.js create mode 100644 src/model/ClusterLayout.js create mode 100644 src/model/CreateBucketRequest.js create mode 100644 src/model/CreateBucketRequestLocalAlias.js create mode 100644 src/model/CreateBucketRequestLocalAliasAllow.js create mode 100644 src/model/GetNodes200Response.js create mode 100644 src/model/ImportKeyRequest.js create mode 100644 src/model/KeyInfo.js create mode 100644 src/model/KeyInfoBucketsInner.js create mode 100644 src/model/KeyInfoBucketsInnerPermissions.js create mode 100644 src/model/KeyInfoPermissions.js create mode 100644 src/model/LayoutVersion.js create mode 100644 src/model/ListBuckets200ResponseInner.js create mode 100644 src/model/ListBuckets200ResponseInnerLocalAliasesInner.js create mode 100644 src/model/ListKeys200ResponseInner.js create mode 100644 src/model/NodeClusterInfo.js create mode 100644 src/model/NodeNetworkInfo.js create mode 100644 src/model/UpdateBucketRequest.js create mode 100644 src/model/UpdateBucketRequestQuotas.js create mode 100644 src/model/UpdateBucketRequestWebsiteAccess.js create mode 100644 src/model/UpdateKeyRequest.js create mode 100644 src/model/UpdateKeyRequestAllow.js create mode 100644 src/model/UpdateKeyRequestDeny.js create mode 100644 test/api/BucketApi.spec.js create mode 100644 test/api/KeyApi.spec.js create mode 100644 test/api/LayoutApi.spec.js create mode 100644 test/api/NodesApi.spec.js create mode 100644 test/model/AddKeyRequest.spec.js create mode 100644 test/model/AddNode200ResponseInner.spec.js create mode 100644 test/model/AllowBucketKeyRequest.spec.js create mode 100644 test/model/AllowBucketKeyRequestPermissions.spec.js create mode 100644 test/model/BucketInfo.spec.js create mode 100644 test/model/BucketInfoQuotas.spec.js create mode 100644 test/model/BucketInfoWebsiteConfig.spec.js create mode 100644 test/model/BucketKeyInfo.spec.js create mode 100644 test/model/ClusterLayout.spec.js create mode 100644 test/model/CreateBucketRequest.spec.js create mode 100644 test/model/CreateBucketRequestLocalAlias.spec.js create mode 100644 test/model/CreateBucketRequestLocalAliasAllow.spec.js create mode 100644 test/model/GetNodes200Response.spec.js create mode 100644 test/model/ImportKeyRequest.spec.js create mode 100644 test/model/KeyInfo.spec.js create mode 100644 test/model/KeyInfoBucketsInner.spec.js create mode 100644 test/model/KeyInfoBucketsInnerPermissions.spec.js create mode 100644 test/model/KeyInfoPermissions.spec.js create mode 100644 test/model/LayoutVersion.spec.js create mode 100644 test/model/ListBuckets200ResponseInner.spec.js create mode 100644 test/model/ListBuckets200ResponseInnerLocalAliasesInner.spec.js create mode 100644 test/model/ListKeys200ResponseInner.spec.js create mode 100644 test/model/NodeClusterInfo.spec.js create mode 100644 test/model/NodeNetworkInfo.spec.js create mode 100644 test/model/UpdateBucketRequest.spec.js create mode 100644 test/model/UpdateBucketRequestQuotas.spec.js create mode 100644 test/model/UpdateBucketRequestWebsiteAccess.spec.js create mode 100644 test/model/UpdateKeyRequest.spec.js create mode 100644 test/model/UpdateKeyRequestAllow.spec.js create mode 100644 test/model/UpdateKeyRequestDeny.spec.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..c73df9d --- /dev/null +++ b/.babelrc @@ -0,0 +1,33 @@ +{ + "presets": [ + "@babel/preset-env" + ], + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions", + "@babel/plugin-proposal-export-default-from", + "@babel/plugin-proposal-logical-assignment-operators", + "@babel/plugin-proposal-optional-chaining", + [ + "@babel/plugin-proposal-pipeline-operator", + { + "proposal": "minimal" + } + ], + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-do-expressions", + "@babel/plugin-proposal-function-bind" + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a7d6d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,130 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..f7b87e8 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,112 @@ +.babelrc +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +docs/AddKeyRequest.md +docs/AddNode200ResponseInner.md +docs/AllowBucketKeyRequest.md +docs/AllowBucketKeyRequestPermissions.md +docs/BucketApi.md +docs/BucketInfo.md +docs/BucketInfoQuotas.md +docs/BucketInfoWebsiteConfig.md +docs/BucketKeyInfo.md +docs/ClusterLayout.md +docs/CreateBucketRequest.md +docs/CreateBucketRequestLocalAlias.md +docs/CreateBucketRequestLocalAliasAllow.md +docs/GetNodes200Response.md +docs/ImportKeyRequest.md +docs/KeyApi.md +docs/KeyInfo.md +docs/KeyInfoBucketsInner.md +docs/KeyInfoBucketsInnerPermissions.md +docs/KeyInfoPermissions.md +docs/LayoutApi.md +docs/LayoutVersion.md +docs/ListBuckets200ResponseInner.md +docs/ListBuckets200ResponseInnerLocalAliasesInner.md +docs/ListKeys200ResponseInner.md +docs/NodeClusterInfo.md +docs/NodeNetworkInfo.md +docs/NodesApi.md +docs/UpdateBucketRequest.md +docs/UpdateBucketRequestQuotas.md +docs/UpdateBucketRequestWebsiteAccess.md +docs/UpdateKeyRequest.md +docs/UpdateKeyRequestAllow.md +docs/UpdateKeyRequestDeny.md +git_push.sh +mocha.opts +package.json +src/ApiClient.js +src/api/BucketApi.js +src/api/KeyApi.js +src/api/LayoutApi.js +src/api/NodesApi.js +src/index.js +src/model/AddKeyRequest.js +src/model/AddNode200ResponseInner.js +src/model/AllowBucketKeyRequest.js +src/model/AllowBucketKeyRequestPermissions.js +src/model/BucketInfo.js +src/model/BucketInfoQuotas.js +src/model/BucketInfoWebsiteConfig.js +src/model/BucketKeyInfo.js +src/model/ClusterLayout.js +src/model/CreateBucketRequest.js +src/model/CreateBucketRequestLocalAlias.js +src/model/CreateBucketRequestLocalAliasAllow.js +src/model/GetNodes200Response.js +src/model/ImportKeyRequest.js +src/model/KeyInfo.js +src/model/KeyInfoBucketsInner.js +src/model/KeyInfoBucketsInnerPermissions.js +src/model/KeyInfoPermissions.js +src/model/LayoutVersion.js +src/model/ListBuckets200ResponseInner.js +src/model/ListBuckets200ResponseInnerLocalAliasesInner.js +src/model/ListKeys200ResponseInner.js +src/model/NodeClusterInfo.js +src/model/NodeNetworkInfo.js +src/model/UpdateBucketRequest.js +src/model/UpdateBucketRequestQuotas.js +src/model/UpdateBucketRequestWebsiteAccess.js +src/model/UpdateKeyRequest.js +src/model/UpdateKeyRequestAllow.js +src/model/UpdateKeyRequestDeny.js +test/api/BucketApi.spec.js +test/api/KeyApi.spec.js +test/api/LayoutApi.spec.js +test/api/NodesApi.spec.js +test/model/AddKeyRequest.spec.js +test/model/AddNode200ResponseInner.spec.js +test/model/AllowBucketKeyRequest.spec.js +test/model/AllowBucketKeyRequestPermissions.spec.js +test/model/BucketInfo.spec.js +test/model/BucketInfoQuotas.spec.js +test/model/BucketInfoWebsiteConfig.spec.js +test/model/BucketKeyInfo.spec.js +test/model/ClusterLayout.spec.js +test/model/CreateBucketRequest.spec.js +test/model/CreateBucketRequestLocalAlias.spec.js +test/model/CreateBucketRequestLocalAliasAllow.spec.js +test/model/GetNodes200Response.spec.js +test/model/ImportKeyRequest.spec.js +test/model/KeyInfo.spec.js +test/model/KeyInfoBucketsInner.spec.js +test/model/KeyInfoBucketsInnerPermissions.spec.js +test/model/KeyInfoPermissions.spec.js +test/model/LayoutVersion.spec.js +test/model/ListBuckets200ResponseInner.spec.js +test/model/ListBuckets200ResponseInnerLocalAliasesInner.spec.js +test/model/ListKeys200ResponseInner.spec.js +test/model/NodeClusterInfo.spec.js +test/model/NodeNetworkInfo.spec.js +test/model/UpdateBucketRequest.spec.js +test/model/UpdateBucketRequestQuotas.spec.js +test/model/UpdateBucketRequestWebsiteAccess.spec.js +test/model/UpdateKeyRequest.spec.js +test/model/UpdateKeyRequestAllow.spec.js +test/model/UpdateKeyRequestDeny.spec.js diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..358e78e --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.1.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0968f7a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +cache: npm +node_js: + - "6" + - "6.1" diff --git a/README.md b/README.md new file mode 100644 index 0000000..0edb76f --- /dev/null +++ b/README.md @@ -0,0 +1,198 @@ +# garage_administration_api_v0garage_v0_8_0 + +garage - JavaScript client for garage_administration_api_v0garage_v0_8_0 +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!* + +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: v0.8.0 +- Package version: v0.8.0 +- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen + +## Installation + +### For [Node.js](https://nodejs.org/) + +#### npm + +To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). + +Then install it via: + +```shell +npm install garage_administration_api_v0garage_v0_8_0 --save +``` + +Finally, you need to build the module: + +```shell +npm run build +``` + +##### Local development + +To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: + +```shell +npm install +``` + +Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: + +```shell +npm link +``` + +To use the link you just defined in your project, switch to the directory you want to use your garage_administration_api_v0garage_v0_8_0 from, and run: + +```shell +npm link /path/to/ +``` + +Finally, you need to build the module: + +```shell +npm run build +``` + +#### git + +If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID +then install it via: + +```shell + npm install GIT_USER_ID/GIT_REPO_ID --save +``` + +### For browser + +The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following +the above steps with Node.js and installing browserify with `npm install -g browserify`, +perform the following (assuming *main.js* is your entry file): + +```shell +browserify main.js > bundle.js +``` + +Then include *bundle.js* in the HTML pages. + +### Webpack Configuration + +Using Webpack you may encounter the following error: "Module not found: Error: +Cannot resolve module", most certainly you should disable AMD loader. Add/merge +the following section to your webpack config: + +```javascript +module: { + rules: [ + { + parser: { + amd: false + } + } + ] +} +``` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following JS code: + +```javascript +var garage = require('garage_administration_api_v0garage_v0_8_0'); + +var defaultClient = garage.ApiClient.instance; +// Configure Bearer access token for authorization: bearerAuth +var bearerAuth = defaultClient.authentications['bearerAuth']; +bearerAuth.accessToken = "YOUR ACCESS TOKEN" + +var api = new garage.BucketApi() +var allowBucketKeyRequest = new garage.AllowBucketKeyRequest(); // {AllowBucketKeyRequest} Aliases to put on the new bucket +var callback = function(error, data, response) { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}; +api.allowBucketKey(allowBucketKeyRequest, callback); + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3903/v0* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*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* | [**deleteBucket**](docs/BucketApi.md#deleteBucket) | **DELETE** /bucket?id={bucket_id} | Delete a bucket +*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* | [**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?id={bucket_id} | Get a bucket +*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* | [**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.KeyApi* | [**addKey**](docs/KeyApi.md#addKey) | **POST** /key | Create a new API key +*garage.KeyApi* | [**deleteKey**](docs/KeyApi.md#deleteKey) | **DELETE** /key?id={access_key} | Delete a key +*garage.KeyApi* | [**getKey**](docs/KeyApi.md#getKey) | **GET** /key?id={access_key} | Get key information +*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* | [**searchKey**](docs/KeyApi.md#searchKey) | **GET** /key?search={pattern} | Select key by pattern +*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* | [**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* | [**revertLayout**](docs/LayoutApi.md#revertLayout) | **POST** /layout/revert | Clear staged layout +*garage.NodesApi* | [**addNode**](docs/NodesApi.md#addNode) | **POST** /connect | Connect target node to other Garage nodes +*garage.NodesApi* | [**getNodes**](docs/NodesApi.md#getNodes) | **GET** /status | Status of this node and other nodes in the cluster + + +## Documentation for Models + + - [garage.AddKeyRequest](docs/AddKeyRequest.md) + - [garage.AddNode200ResponseInner](docs/AddNode200ResponseInner.md) + - [garage.AllowBucketKeyRequest](docs/AllowBucketKeyRequest.md) + - [garage.AllowBucketKeyRequestPermissions](docs/AllowBucketKeyRequestPermissions.md) + - [garage.BucketInfo](docs/BucketInfo.md) + - [garage.BucketInfoQuotas](docs/BucketInfoQuotas.md) + - [garage.BucketInfoWebsiteConfig](docs/BucketInfoWebsiteConfig.md) + - [garage.BucketKeyInfo](docs/BucketKeyInfo.md) + - [garage.ClusterLayout](docs/ClusterLayout.md) + - [garage.CreateBucketRequest](docs/CreateBucketRequest.md) + - [garage.CreateBucketRequestLocalAlias](docs/CreateBucketRequestLocalAlias.md) + - [garage.CreateBucketRequestLocalAliasAllow](docs/CreateBucketRequestLocalAliasAllow.md) + - [garage.GetNodes200Response](docs/GetNodes200Response.md) + - [garage.ImportKeyRequest](docs/ImportKeyRequest.md) + - [garage.KeyInfo](docs/KeyInfo.md) + - [garage.KeyInfoBucketsInner](docs/KeyInfoBucketsInner.md) + - [garage.KeyInfoBucketsInnerPermissions](docs/KeyInfoBucketsInnerPermissions.md) + - [garage.KeyInfoPermissions](docs/KeyInfoPermissions.md) + - [garage.LayoutVersion](docs/LayoutVersion.md) + - [garage.ListBuckets200ResponseInner](docs/ListBuckets200ResponseInner.md) + - [garage.ListBuckets200ResponseInnerLocalAliasesInner](docs/ListBuckets200ResponseInnerLocalAliasesInner.md) + - [garage.ListKeys200ResponseInner](docs/ListKeys200ResponseInner.md) + - [garage.NodeClusterInfo](docs/NodeClusterInfo.md) + - [garage.NodeNetworkInfo](docs/NodeNetworkInfo.md) + - [garage.UpdateBucketRequest](docs/UpdateBucketRequest.md) + - [garage.UpdateBucketRequestQuotas](docs/UpdateBucketRequestQuotas.md) + - [garage.UpdateBucketRequestWebsiteAccess](docs/UpdateBucketRequestWebsiteAccess.md) + - [garage.UpdateKeyRequest](docs/UpdateKeyRequest.md) + - [garage.UpdateKeyRequestAllow](docs/UpdateKeyRequestAllow.md) + - [garage.UpdateKeyRequestDeny](docs/UpdateKeyRequestDeny.md) + + +## Documentation for Authorization + + + +### bearerAuth + +- **Type**: Bearer authentication + diff --git a/docs/AddKeyRequest.md b/docs/AddKeyRequest.md new file mode 100644 index 0000000..558e1b7 --- /dev/null +++ b/docs/AddKeyRequest.md @@ -0,0 +1,9 @@ +# garage.AddKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + diff --git a/docs/AddNode200ResponseInner.md b/docs/AddNode200ResponseInner.md new file mode 100644 index 0000000..1d70a1d --- /dev/null +++ b/docs/AddNode200ResponseInner.md @@ -0,0 +1,10 @@ +# garage.AddNode200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**error** | **String** | | [optional] + + diff --git a/docs/AllowBucketKeyRequest.md b/docs/AllowBucketKeyRequest.md new file mode 100644 index 0000000..815c9a5 --- /dev/null +++ b/docs/AllowBucketKeyRequest.md @@ -0,0 +1,11 @@ +# garage.AllowBucketKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bucketId** | **String** | | +**accessKeyId** | **String** | | +**permissions** | [**AllowBucketKeyRequestPermissions**](AllowBucketKeyRequestPermissions.md) | | + + diff --git a/docs/AllowBucketKeyRequestPermissions.md b/docs/AllowBucketKeyRequestPermissions.md new file mode 100644 index 0000000..e8f8357 --- /dev/null +++ b/docs/AllowBucketKeyRequestPermissions.md @@ -0,0 +1,11 @@ +# garage.AllowBucketKeyRequestPermissions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**read** | **Boolean** | | +**write** | **Boolean** | | +**owner** | **Boolean** | | + + diff --git a/docs/BucketApi.md b/docs/BucketApi.md new file mode 100644 index 0000000..5251168 --- /dev/null +++ b/docs/BucketApi.md @@ -0,0 +1,618 @@ +# garage.BucketApi + +All URIs are relative to *http://localhost:3903/v0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**allowBucketKey**](BucketApi.md#allowBucketKey) | **POST** /bucket/allow | Allow key +[**createBucket**](BucketApi.md#createBucket) | **POST** /bucket | Create a bucket +[**deleteBucket**](BucketApi.md#deleteBucket) | **DELETE** /bucket?id={bucket_id} | Delete a bucket +[**deleteBucketGlobalAlias**](BucketApi.md#deleteBucketGlobalAlias) | **DELETE** /bucket/alias/global | Delete a global alias +[**deleteBucketLocalAlias**](BucketApi.md#deleteBucketLocalAlias) | **DELETE** /bucket/alias/local | Delete a local alias +[**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?id={bucket_id} | Get a bucket +[**listBuckets**](BucketApi.md#listBuckets) | **GET** /bucket | List all buckets +[**putBucketGlobalAlias**](BucketApi.md#putBucketGlobalAlias) | **PUT** /bucket/alias/global | Add a global 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 + + + +## allowBucketKey + +> BucketInfo allowBucketKey(allowBucketKeyRequest) + +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. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 allowBucketKeyRequest = new garage.AllowBucketKeyRequest(); // AllowBucketKeyRequest | Aliases to put on the new bucket +apiInstance.allowBucketKey(allowBucketKeyRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **allowBucketKeyRequest** | [**AllowBucketKeyRequest**](AllowBucketKeyRequest.md)| Aliases to put on the new bucket | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## createBucket + +> BucketInfo createBucket(createBucketRequest) + +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. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 createBucketRequest = new garage.CreateBucketRequest(); // CreateBucketRequest | Aliases to put on the new bucket +apiInstance.createBucket(createBucketRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createBucketRequest** | [**CreateBucketRequest**](CreateBucketRequest.md)| Aliases to put on the new bucket | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## deleteBucket + +> deleteBucket(bucketId) + +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! + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string +apiInstance.deleteBucket(bucketId, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string | + +### Return type + +null (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## deleteBucketGlobalAlias + +> BucketInfo deleteBucketGlobalAlias(id, alias) + +Delete a global alias + +Delete a global alias from the target bucket + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 id = e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b; // String | +let alias = my_documents; // String | +apiInstance.deleteBucketGlobalAlias(id, alias, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **alias** | **String**| | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## deleteBucketLocalAlias + +> BucketInfo deleteBucketLocalAlias(id, accessKeyId, alias) + +Delete a local alias + +Delete a local alias, bound to specified account, from the target bucket + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 id = e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b; // String | +let accessKeyId = GK31c2f218a2e44f485b94239e; // String | +let alias = my_documents; // String | +apiInstance.deleteBucketLocalAlias(id, accessKeyId, alias, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **accessKeyId** | **String**| | + **alias** | **String**| | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## denyBucketKey + +> BucketInfo denyBucketKey(allowBucketKeyRequest) + +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. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 allowBucketKeyRequest = new garage.AllowBucketKeyRequest(); // AllowBucketKeyRequest | Aliases to put on the new bucket +apiInstance.denyBucketKey(allowBucketKeyRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **allowBucketKeyRequest** | [**AllowBucketKeyRequest**](AllowBucketKeyRequest.md)| Aliases to put on the new bucket | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: 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_8_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, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### 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 + +> BucketInfo getBucketInfo(bucketId) + +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). + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 bucketId = b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87; // String | The exact bucket identifier, a 32 bytes hexadecimal string +apiInstance.getBucketInfo(bucketId, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## listBuckets + +> [ListBuckets200ResponseInner] listBuckets() + +List all buckets + +List all the buckets on the cluster with their UUID and their global and local aliases. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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(); +apiInstance.listBuckets((error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**[ListBuckets200ResponseInner]**](ListBuckets200ResponseInner.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## putBucketGlobalAlias + +> BucketInfo putBucketGlobalAlias(id, alias) + +Add a global alias + +Add a global alias to the target bucket + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 id = e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b; // String | +let alias = my_documents; // String | +apiInstance.putBucketGlobalAlias(id, alias, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **alias** | **String**| | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## putBucketLocalAlias + +> BucketInfo putBucketLocalAlias(id, accessKeyId, alias) + +Add a local alias + +Add a local alias, bound to specified account, to the target bucket + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 id = e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b; // String | +let accessKeyId = GK31c2f218a2e44f485b94239e; // String | +let alias = my_documents; // String | +apiInstance.putBucketLocalAlias(id, accessKeyId, alias, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **accessKeyId** | **String**| | + **alias** | **String**| | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## updateBucket + +> BucketInfo updateBucket(bucketId, updateBucketRequest) + +Update a bucket + +All fields (`websiteAccess` and `quotas`) are optionnal. 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. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 bucketId = 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. +apiInstance.updateBucket(bucketId, updateBucketRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bucketId** | **String**| The exact bucket identifier, a 32 bytes hexadecimal string | + **updateBucketRequest** | [**UpdateBucketRequest**](UpdateBucketRequest.md)| Requested changes on the bucket. Both root fields are optionals. | + +### Return type + +[**BucketInfo**](BucketInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/BucketInfo.md b/docs/BucketInfo.md new file mode 100644 index 0000000..85742e1 --- /dev/null +++ b/docs/BucketInfo.md @@ -0,0 +1,17 @@ +# garage.BucketInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**globalAliases** | **[String]** | | [optional] +**websiteAccess** | **Boolean** | | [optional] +**websiteConfig** | [**BucketInfoWebsiteConfig**](BucketInfoWebsiteConfig.md) | | [optional] +**keys** | [**[BucketKeyInfo]**](BucketKeyInfo.md) | | [optional] +**objects** | **Number** | | [optional] +**bytes** | **Number** | | [optional] +**unfinishedUploads** | **Number** | | [optional] +**quotas** | [**BucketInfoQuotas**](BucketInfoQuotas.md) | | [optional] + + diff --git a/docs/BucketInfoQuotas.md b/docs/BucketInfoQuotas.md new file mode 100644 index 0000000..3a7ebf3 --- /dev/null +++ b/docs/BucketInfoQuotas.md @@ -0,0 +1,10 @@ +# garage.BucketInfoQuotas + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxSize** | **Number** | | [optional] +**maxObjects** | **Number** | | [optional] + + diff --git a/docs/BucketInfoWebsiteConfig.md b/docs/BucketInfoWebsiteConfig.md new file mode 100644 index 0000000..f9caf33 --- /dev/null +++ b/docs/BucketInfoWebsiteConfig.md @@ -0,0 +1,10 @@ +# garage.BucketInfoWebsiteConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**indexDocument** | **String** | | [optional] +**errorDocument** | **String** | | [optional] + + diff --git a/docs/BucketKeyInfo.md b/docs/BucketKeyInfo.md new file mode 100644 index 0000000..0ce8851 --- /dev/null +++ b/docs/BucketKeyInfo.md @@ -0,0 +1,12 @@ +# garage.BucketKeyInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessKeyId** | **String** | | [optional] +**name** | **String** | | [optional] +**permissions** | [**CreateBucketRequestLocalAliasAllow**](CreateBucketRequestLocalAliasAllow.md) | | [optional] +**bucketLocalAliases** | **[String]** | | [optional] + + diff --git a/docs/ClusterLayout.md b/docs/ClusterLayout.md new file mode 100644 index 0000000..7918431 --- /dev/null +++ b/docs/ClusterLayout.md @@ -0,0 +1,11 @@ +# garage.ClusterLayout + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **Number** | | +**roles** | [**{String: NodeClusterInfo}**](NodeClusterInfo.md) | | +**stagedRoleChanges** | [**{String: NodeClusterInfo}**](NodeClusterInfo.md) | | + + diff --git a/docs/CreateBucketRequest.md b/docs/CreateBucketRequest.md new file mode 100644 index 0000000..0d24199 --- /dev/null +++ b/docs/CreateBucketRequest.md @@ -0,0 +1,10 @@ +# garage.CreateBucketRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**globalAlias** | **String** | | [optional] +**localAlias** | [**CreateBucketRequestLocalAlias**](CreateBucketRequestLocalAlias.md) | | [optional] + + diff --git a/docs/CreateBucketRequestLocalAlias.md b/docs/CreateBucketRequestLocalAlias.md new file mode 100644 index 0000000..d9d7289 --- /dev/null +++ b/docs/CreateBucketRequestLocalAlias.md @@ -0,0 +1,11 @@ +# garage.CreateBucketRequestLocalAlias + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accessKeyId** | **String** | | [optional] +**alias** | **String** | | [optional] +**allow** | [**CreateBucketRequestLocalAliasAllow**](CreateBucketRequestLocalAliasAllow.md) | | [optional] + + diff --git a/docs/CreateBucketRequestLocalAliasAllow.md b/docs/CreateBucketRequestLocalAliasAllow.md new file mode 100644 index 0000000..09cb07c --- /dev/null +++ b/docs/CreateBucketRequestLocalAliasAllow.md @@ -0,0 +1,11 @@ +# garage.CreateBucketRequestLocalAliasAllow + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**read** | **Boolean** | | [optional] +**write** | **Boolean** | | [optional] +**owner** | **Boolean** | | [optional] + + diff --git a/docs/GetNodes200Response.md b/docs/GetNodes200Response.md new file mode 100644 index 0000000..bcf6758 --- /dev/null +++ b/docs/GetNodes200Response.md @@ -0,0 +1,12 @@ +# garage.GetNodes200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**node** | **String** | | +**garageVersion** | **String** | | +**knownNodes** | [**{String: NodeNetworkInfo}**](NodeNetworkInfo.md) | | +**layout** | [**ClusterLayout**](ClusterLayout.md) | | + + diff --git a/docs/ImportKeyRequest.md b/docs/ImportKeyRequest.md new file mode 100644 index 0000000..3de7d4e --- /dev/null +++ b/docs/ImportKeyRequest.md @@ -0,0 +1,11 @@ +# garage.ImportKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**accessKeyId** | **String** | | +**secretAccessKey** | **String** | | + + diff --git a/docs/KeyApi.md b/docs/KeyApi.md new file mode 100644 index 0000000..99cbcde --- /dev/null +++ b/docs/KeyApi.md @@ -0,0 +1,356 @@ +# garage.KeyApi + +All URIs are relative to *http://localhost:3903/v0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addKey**](KeyApi.md#addKey) | **POST** /key | Create a new API key +[**deleteKey**](KeyApi.md#deleteKey) | **DELETE** /key?id={access_key} | Delete a key +[**getKey**](KeyApi.md#getKey) | **GET** /key?id={access_key} | Get key information +[**importKey**](KeyApi.md#importKey) | **POST** /key/import | Import an existing key +[**listKeys**](KeyApi.md#listKeys) | **GET** /key | List all keys +[**searchKey**](KeyApi.md#searchKey) | **GET** /key?search={pattern} | Select key by pattern +[**updateKey**](KeyApi.md#updateKey) | **POST** /key?id={access_key} | Update a key + + + +## addKey + +> KeyInfo addKey(addKeyRequest) + +Create a new API key + +Creates a new API access key. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 addKeyRequest = new garage.AddKeyRequest(); // AddKeyRequest | \"You can set a friendly name for this key, send an empty string instead\" +apiInstance.addKey(addKeyRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **addKeyRequest** | [**AddKeyRequest**](AddKeyRequest.md)| \"You can set a friendly name for this key, send an empty string instead\" | + +### Return type + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## deleteKey + +> deleteKey(accessKey) + +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. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage +apiInstance.deleteKey(accessKey, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessKey** | **String**| The exact API access key generated by Garage | + +### Return type + +null (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getKey + +> KeyInfo getKey(accessKey) + +Get key information + +Return information about a specific key and return its information + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 accessKey = GK31c2f218a2e44f485b94239e; // String | The exact API access key generated by Garage +apiInstance.getKey(accessKey, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessKey** | **String**| The exact API access key generated by Garage | + +### Return type + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## importKey + +> KeyInfo importKey(importKeyRequest) + +Import an existing key + +Imports an existing API key. This feature must only be used for migrations and backup restore. **Do not use it to generate custom key identifiers or you will break your Garage cluster.** + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 importKeyRequest = new garage.ImportKeyRequest(); // ImportKeyRequest | Information on the key to import +apiInstance.importKey(importKeyRequest, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **importKeyRequest** | [**ImportKeyRequest**](ImportKeyRequest.md)| Information on the key to import | + +### Return type + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## listKeys + +> [ListKeys200ResponseInner] listKeys() + +List all keys + +Returns all API access keys in the cluster. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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(); +apiInstance.listKeys((error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**[ListKeys200ResponseInner]**](ListKeys200ResponseInner.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## searchKey + +> KeyInfo searchKey(pattern) + +Select key by pattern + +Find the first key matching the given pattern based on its identifier aor friendly name and return its information. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 +apiInstance.searchKey(pattern, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pattern** | **String**| A pattern (beginning or full string) corresponding to a key identifier or friendly name | + +### Return type + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## updateKey + +> KeyInfo updateKey(accessKey, updateKeyRequest) + +Update a key + +Updates information about the specified API access key. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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 accessKey = 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, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessKey** | **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 + +[**KeyInfo**](KeyInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/KeyInfo.md b/docs/KeyInfo.md new file mode 100644 index 0000000..fff00b1 --- /dev/null +++ b/docs/KeyInfo.md @@ -0,0 +1,13 @@ +# garage.KeyInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**accessKeyId** | **String** | | [optional] +**secretAccessKey** | **String** | | [optional] +**permissions** | [**KeyInfoPermissions**](KeyInfoPermissions.md) | | [optional] +**buckets** | [**[KeyInfoBucketsInner]**](KeyInfoBucketsInner.md) | | [optional] + + diff --git a/docs/KeyInfoBucketsInner.md b/docs/KeyInfoBucketsInner.md new file mode 100644 index 0000000..4e43408 --- /dev/null +++ b/docs/KeyInfoBucketsInner.md @@ -0,0 +1,12 @@ +# garage.KeyInfoBucketsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**globalAliases** | **[String]** | | [optional] +**localAliases** | **[String]** | | [optional] +**permissions** | [**KeyInfoBucketsInnerPermissions**](KeyInfoBucketsInnerPermissions.md) | | [optional] + + diff --git a/docs/KeyInfoBucketsInnerPermissions.md b/docs/KeyInfoBucketsInnerPermissions.md new file mode 100644 index 0000000..9e6b3d7 --- /dev/null +++ b/docs/KeyInfoBucketsInnerPermissions.md @@ -0,0 +1,11 @@ +# garage.KeyInfoBucketsInnerPermissions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**read** | **Boolean** | | [optional] +**write** | **Boolean** | | [optional] +**owner** | **Boolean** | | [optional] + + diff --git a/docs/KeyInfoPermissions.md b/docs/KeyInfoPermissions.md new file mode 100644 index 0000000..ccf75d1 --- /dev/null +++ b/docs/KeyInfoPermissions.md @@ -0,0 +1,9 @@ +# garage.KeyInfoPermissions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createBucket** | **Boolean** | | [optional] + + diff --git a/docs/LayoutApi.md b/docs/LayoutApi.md new file mode 100644 index 0000000..89d0d29 --- /dev/null +++ b/docs/LayoutApi.md @@ -0,0 +1,204 @@ +# garage.LayoutApi + +All URIs are relative to *http://localhost:3903/v0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addLayout**](LayoutApi.md#addLayout) | **POST** /layout | Send modifications to the cluster layout +[**applyLayout**](LayoutApi.md#applyLayout) | **POST** /layout/apply | Apply staged layout +[**getLayout**](LayoutApi.md#getLayout) | **GET** /layout | Details on the current and staged layout +[**revertLayout**](LayoutApi.md#revertLayout) | **POST** /layout/revert | Clear staged layout + + + +## addLayout + +> addLayout(requestBody) + +Send modifications to the cluster layout + +Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of `GET /layout`. Once the set of staged changes is satisfactory, the user may call `POST /layout/apply` to apply the changed changes, or `POST /layout/revert` to clear all of the staged changes in the layout. Note that setting the capacity to `null` will configure the node as a gateway. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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.LayoutApi(); +let requestBody = {key: new garage.NodeClusterInfo()}; // {String: NodeClusterInfo} | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. +apiInstance.addLayout(requestBody, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**{String: NodeClusterInfo}**](NodeClusterInfo.md)| To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. | + +### Return type + +null (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## applyLayout + +> applyLayout(layoutVersion) + +Apply staged layout + +Applies to the cluster the layout changes currently registered as staged layout changes. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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.LayoutApi(); +let layoutVersion = new garage.LayoutVersion(); // LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. +apiInstance.applyLayout(layoutVersion, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **layoutVersion** | [**LayoutVersion**](LayoutVersion.md)| Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. | + +### Return type + +null (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## getLayout + +> ClusterLayout getLayout() + +Details on the current and staged layout + +Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by `GET /status`.* + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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.LayoutApi(); +apiInstance.getLayout((error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ClusterLayout**](ClusterLayout.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## revertLayout + +> revertLayout(layoutVersion) + +Clear staged layout + +Clears all of the staged layout changes. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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.LayoutApi(); +let layoutVersion = new garage.LayoutVersion(); // LayoutVersion | Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster. +apiInstance.revertLayout(layoutVersion, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully.'); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **layoutVersion** | [**LayoutVersion**](LayoutVersion.md)| Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster. | + +### Return type + +null (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + diff --git a/docs/LayoutVersion.md b/docs/LayoutVersion.md new file mode 100644 index 0000000..521aa5d --- /dev/null +++ b/docs/LayoutVersion.md @@ -0,0 +1,9 @@ +# garage.LayoutVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **Number** | | [optional] + + diff --git a/docs/ListBuckets200ResponseInner.md b/docs/ListBuckets200ResponseInner.md new file mode 100644 index 0000000..a8369a9 --- /dev/null +++ b/docs/ListBuckets200ResponseInner.md @@ -0,0 +1,11 @@ +# garage.ListBuckets200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**globalAliases** | **[String]** | | [optional] +**localAliases** | [**[ListBuckets200ResponseInnerLocalAliasesInner]**](ListBuckets200ResponseInnerLocalAliasesInner.md) | | [optional] + + diff --git a/docs/ListBuckets200ResponseInnerLocalAliasesInner.md b/docs/ListBuckets200ResponseInnerLocalAliasesInner.md new file mode 100644 index 0000000..9cd2ce9 --- /dev/null +++ b/docs/ListBuckets200ResponseInnerLocalAliasesInner.md @@ -0,0 +1,10 @@ +# garage.ListBuckets200ResponseInnerLocalAliasesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alias** | **String** | | +**accessKeyId** | **String** | | + + diff --git a/docs/ListKeys200ResponseInner.md b/docs/ListKeys200ResponseInner.md new file mode 100644 index 0000000..5975ab9 --- /dev/null +++ b/docs/ListKeys200ResponseInner.md @@ -0,0 +1,10 @@ +# garage.ListKeys200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**name** | **String** | | [optional] + + diff --git a/docs/NodeClusterInfo.md b/docs/NodeClusterInfo.md new file mode 100644 index 0000000..da13ef3 --- /dev/null +++ b/docs/NodeClusterInfo.md @@ -0,0 +1,11 @@ +# garage.NodeClusterInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**zone** | **String** | | +**capacity** | **Number** | | +**tags** | **[String]** | User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage | + + diff --git a/docs/NodeNetworkInfo.md b/docs/NodeNetworkInfo.md new file mode 100644 index 0000000..943734c --- /dev/null +++ b/docs/NodeNetworkInfo.md @@ -0,0 +1,12 @@ +# garage.NodeNetworkInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addr** | **String** | | +**isUp** | **Boolean** | | +**lastSeenSecsAgo** | **Number** | | +**hostname** | **String** | | + + diff --git a/docs/NodesApi.md b/docs/NodesApi.md new file mode 100644 index 0000000..8f91109 --- /dev/null +++ b/docs/NodesApi.md @@ -0,0 +1,104 @@ +# garage.NodesApi + +All URIs are relative to *http://localhost:3903/v0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addNode**](NodesApi.md#addNode) | **POST** /connect | Connect target node to other Garage nodes +[**getNodes**](NodesApi.md#getNodes) | **GET** /status | Status of this node and other nodes in the cluster + + + +## addNode + +> [AddNode200ResponseInner] addNode(requestBody) + +Connect target node to other Garage nodes + +Instructs this Garage node to connect to other Garage nodes at specified `<node_id>@<net_address>`. `node_id` is generated automatically on node start. + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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.NodesApi(); +let requestBody = ["null"]; // [String] | +apiInstance.addNode(requestBody, (error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**[String]**](String.md)| | + +### Return type + +[**[AddNode200ResponseInner]**](AddNode200ResponseInner.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## getNodes + +> GetNodes200Response getNodes() + +Status of this node and other nodes in the cluster + +Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout + +### Example + +```javascript +import garage from 'garage_administration_api_v0garage_v0_8_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.NodesApi(); +apiInstance.getNodes((error, data, response) => { + if (error) { + console.error(error); + } else { + console.log('API called successfully. Returned data: ' + data); + } +}); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**GetNodes200Response**](GetNodes200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/UpdateBucketRequest.md b/docs/UpdateBucketRequest.md new file mode 100644 index 0000000..1786d43 --- /dev/null +++ b/docs/UpdateBucketRequest.md @@ -0,0 +1,10 @@ +# garage.UpdateBucketRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**websiteAccess** | [**UpdateBucketRequestWebsiteAccess**](UpdateBucketRequestWebsiteAccess.md) | | [optional] +**quotas** | [**UpdateBucketRequestQuotas**](UpdateBucketRequestQuotas.md) | | [optional] + + diff --git a/docs/UpdateBucketRequestQuotas.md b/docs/UpdateBucketRequestQuotas.md new file mode 100644 index 0000000..b344626 --- /dev/null +++ b/docs/UpdateBucketRequestQuotas.md @@ -0,0 +1,10 @@ +# garage.UpdateBucketRequestQuotas + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxSize** | **Number** | | [optional] +**maxObjects** | **Number** | | [optional] + + diff --git a/docs/UpdateBucketRequestWebsiteAccess.md b/docs/UpdateBucketRequestWebsiteAccess.md new file mode 100644 index 0000000..c1fbb63 --- /dev/null +++ b/docs/UpdateBucketRequestWebsiteAccess.md @@ -0,0 +1,11 @@ +# garage.UpdateBucketRequestWebsiteAccess + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **Boolean** | | [optional] +**indexDocument** | **String** | | [optional] +**errorDocument** | **String** | | [optional] + + diff --git a/docs/UpdateKeyRequest.md b/docs/UpdateKeyRequest.md new file mode 100644 index 0000000..5fbbcd1 --- /dev/null +++ b/docs/UpdateKeyRequest.md @@ -0,0 +1,11 @@ +# garage.UpdateKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**allow** | [**UpdateKeyRequestAllow**](UpdateKeyRequestAllow.md) | | [optional] +**deny** | [**UpdateKeyRequestDeny**](UpdateKeyRequestDeny.md) | | [optional] + + diff --git a/docs/UpdateKeyRequestAllow.md b/docs/UpdateKeyRequestAllow.md new file mode 100644 index 0000000..2270595 --- /dev/null +++ b/docs/UpdateKeyRequestAllow.md @@ -0,0 +1,9 @@ +# garage.UpdateKeyRequestAllow + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createBucket** | **Boolean** | | [optional] + + diff --git a/docs/UpdateKeyRequestDeny.md b/docs/UpdateKeyRequestDeny.md new file mode 100644 index 0000000..b8001fd --- /dev/null +++ b/docs/UpdateKeyRequestDeny.md @@ -0,0 +1,9 @@ +# garage.UpdateKeyRequestDeny + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createBucket** | **Boolean** | | [optional] + + diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/mocha.opts b/mocha.opts new file mode 100644 index 0000000..9070118 --- /dev/null +++ b/mocha.opts @@ -0,0 +1 @@ +--timeout 10000 diff --git a/package.json b/package.json new file mode 100644 index 0000000..302ed1c --- /dev/null +++ b/package.json @@ -0,0 +1,46 @@ +{ + "name": "garage_administration_api_v0garage_v0_8_0", + "version": "v0.8.0", + "description": "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!* ", + "license": "Unlicense", + "main": "dist/index.js", + "scripts": { + "build": "babel src -d dist", + "prepare": "npm run build", + "test": "mocha --require @babel/register --recursive" + }, + "browser": { + "fs": false + }, + "dependencies": { + "@babel/cli": "^7.0.0", + "superagent": "^5.3.0" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", + "expect.js": "^0.3.1", + "mocha": "^8.0.1", + "sinon": "^7.2.0" + }, + "files": [ + "dist" + ] +} diff --git a/src/ApiClient.js b/src/ApiClient.js new file mode 100644 index 0000000..39c9eeb --- /dev/null +++ b/src/ApiClient.js @@ -0,0 +1,692 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import superagent from "superagent"; +import querystring from "querystring"; + +/** +* @module ApiClient +* @version v0.8.0 +*/ + +/** +* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an +* application to use this class directly - the *Api and model classes provide the public API for the service. The +* contents of this file should be regarded as internal but are documented for completeness. +* @alias module:ApiClient +* @class +*/ +class ApiClient { + /** + * The base URL against which to resolve every API call's (relative) path. + * Overrides the default value set in spec file if present + * @param {String} basePath + */ + constructor(basePath = 'http://localhost:3903/v0') { + /** + * The base URL against which to resolve every API call's (relative) path. + * @type {String} + * @default http://localhost:3903/v0 + */ + this.basePath = basePath.replace(/\/+$/, ''); + + /** + * The authentication methods to be included for all API calls. + * @type {Array.} + */ + this.authentications = { + 'bearerAuth': {type: 'bearer'} + } + + /** + * The default HTTP headers to be included for all API calls. + * @type {Array.} + * @default {} + */ + this.defaultHeaders = { + 'User-Agent': 'OpenAPI-Generator/v0.8.0/Javascript' + }; + + /** + * The default HTTP timeout for all API calls. + * @type {Number} + * @default 60000 + */ + this.timeout = 60000; + + /** + * If set to false an additional timestamp parameter is added to all API GET calls to + * prevent browser caching + * @type {Boolean} + * @default true + */ + this.cache = true; + + /** + * If set to true, the client will save the cookies from each server + * response, and return them in the next request. + * @default false + */ + this.enableCookies = false; + + /* + * Used to save and return cookies in a node.js (non-browser) setting, + * if this.enableCookies is set to true. + */ + if (typeof window === 'undefined') { + this.agent = new superagent.agent(); + } + + /* + * Allow user to override superagent agent + */ + this.requestAgent = null; + + /* + * Allow user to add superagent plugins + */ + this.plugins = null; + + } + + /** + * Returns a string representation for an actual parameter. + * @param param The actual parameter. + * @returns {String} The string representation of param. + */ + paramToString(param) { + if (param == undefined || param == null) { + return ''; + } + if (param instanceof Date) { + return param.toJSON(); + } + if (ApiClient.canBeJsonified(param)) { + return JSON.stringify(param); + } + + return param.toString(); + } + + /** + * Returns a boolean indicating if the parameter could be JSON.stringified + * @param param The actual parameter + * @returns {Boolean} Flag indicating if param can be JSON.stringified + */ + static canBeJsonified(str) { + if (typeof str !== 'string' && typeof str !== 'object') return false; + try { + const type = str.toString(); + return type === '[object Object]' + || type === '[object Array]'; + } catch (err) { + return false; + } + }; + + /** + * Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values. + * NOTE: query parameters are not handled here. + * @param {String} path The path to append to the base URL. + * @param {Object} pathParams The parameter values to append. + * @param {String} apiBasePath Base path defined in the path, operation level to override the default one + * @returns {String} The encoded path with parameter values substituted. + */ + buildUrl(path, pathParams, apiBasePath) { + if (!path.match(/^\//)) { + path = '/' + path; + } + + var url = this.basePath + path; + + // use API (operation, path) base path if defined + if (apiBasePath !== null && apiBasePath !== undefined) { + url = apiBasePath + path; + } + + url = url.replace(/\{([\w-\.]+)\}/g, (fullMatch, key) => { + var value; + if (pathParams.hasOwnProperty(key)) { + value = this.paramToString(pathParams[key]); + } else { + value = fullMatch; + } + + return encodeURIComponent(value); + }); + + return url; + } + + /** + * Checks whether the given content type represents JSON.
+ * JSON content type examples:
+ *
    + *
  • application/json
  • + *
  • application/json; charset=UTF8
  • + *
  • APPLICATION/JSON
  • + *
+ * @param {String} contentType The MIME content type to check. + * @returns {Boolean} true if contentType represents JSON, otherwise false. + */ + isJsonMime(contentType) { + return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i)); + } + + /** + * Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first. + * @param {Array.} contentTypes + * @returns {String} The chosen content type, preferring JSON. + */ + jsonPreferredMime(contentTypes) { + for (var i = 0; i < contentTypes.length; i++) { + if (this.isJsonMime(contentTypes[i])) { + return contentTypes[i]; + } + } + + return contentTypes[0]; + } + + /** + * Checks whether the given parameter value represents file-like content. + * @param param The parameter to check. + * @returns {Boolean} true if param represents a file. + */ + isFileParam(param) { + // fs.ReadStream in Node.js and Electron (but not in runtime like browserify) + if (typeof require === 'function') { + let fs; + try { + fs = require('fs'); + } catch (err) {} + if (fs && fs.ReadStream && param instanceof fs.ReadStream) { + return true; + } + } + + // Buffer in Node.js + if (typeof Buffer === 'function' && param instanceof Buffer) { + return true; + } + + // Blob in browser + if (typeof Blob === 'function' && param instanceof Blob) { + return true; + } + + // File in browser (it seems File object is also instance of Blob, but keep this for safe) + if (typeof File === 'function' && param instanceof File) { + return true; + } + + return false; + } + + /** + * Normalizes parameter values: + *
    + *
  • remove nils
  • + *
  • keep files and arrays
  • + *
  • format to string with `paramToString` for other cases
  • + *
+ * @param {Object.} params The parameters as object properties. + * @returns {Object.} normalized parameters. + */ + normalizeParams(params) { + var newParams = {}; + for (var key in params) { + if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) { + var value = params[key]; + if (this.isFileParam(value) || Array.isArray(value)) { + newParams[key] = value; + } else { + newParams[key] = this.paramToString(value); + } + } + } + + return newParams; + } + + /** + * Builds a string representation of an array-type actual parameter, according to the given collection format. + * @param {Array} param An array parameter. + * @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns + * param as is if collectionFormat is multi. + */ + buildCollectionParam(param, collectionFormat) { + if (param == null) { + return null; + } + switch (collectionFormat) { + case 'csv': + return param.map(this.paramToString, this).join(','); + case 'ssv': + return param.map(this.paramToString, this).join(' '); + case 'tsv': + return param.map(this.paramToString, this).join('\t'); + case 'pipes': + return param.map(this.paramToString, this).join('|'); + case 'multi': + //return the array directly as SuperAgent will handle it as expected + return param.map(this.paramToString, this); + case 'passthrough': + return param; + default: + throw new Error('Unknown collection format: ' + collectionFormat); + } + } + + /** + * Applies authentication headers to the request. + * @param {Object} request The request object created by a superagent() call. + * @param {Array.} authNames An array of authentication method names. + */ + applyAuthToRequest(request, authNames) { + authNames.forEach((authName) => { + var auth = this.authentications[authName]; + switch (auth.type) { + case 'basic': + if (auth.username || auth.password) { + request.auth(auth.username || '', auth.password || ''); + } + + break; + case 'bearer': + if (auth.accessToken) { + var localVarBearerToken = typeof auth.accessToken === 'function' + ? auth.accessToken() + : auth.accessToken + request.set({'Authorization': 'Bearer ' + localVarBearerToken}); + } + + break; + case 'apiKey': + if (auth.apiKey) { + var data = {}; + if (auth.apiKeyPrefix) { + data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey; + } else { + data[auth.name] = auth.apiKey; + } + + if (auth['in'] === 'header') { + request.set(data); + } else { + request.query(data); + } + } + + break; + case 'oauth2': + if (auth.accessToken) { + request.set({'Authorization': 'Bearer ' + auth.accessToken}); + } + + break; + default: + throw new Error('Unknown authentication type: ' + auth.type); + } + }); + } + + /** + * Deserializes an HTTP response body into a value of the specified type. + * @param {Object} response A SuperAgent response object. + * @param {(String|Array.|Object.|Function)} returnType The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns A value of the specified type. + */ + deserialize(response, returnType) { + if (response == null || returnType == null || response.status == 204) { + return null; + } + + // Rely on SuperAgent for parsing response body. + // See http://visionmedia.github.io/superagent/#parsing-response-bodies + var data = response.body; + if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) { + // SuperAgent does not always produce a body; use the unparsed response as a fallback + data = response.text; + } + + return ApiClient.convertToType(data, returnType); + } + + /** + * Callback function to receive the result of the operation. + * @callback module:ApiClient~callApiCallback + * @param {String} error Error message, if any. + * @param data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Invokes the REST service using the supplied settings and parameters. + * @param {String} path The base URL to invoke. + * @param {String} httpMethod The HTTP method to use. + * @param {Object.} pathParams A map of path parameters and their values. + * @param {Object.} queryParams A map of query parameters and their values. + * @param {Object.} headerParams A map of header parameters and their values. + * @param {Object.} formParams A map of form parameters and their values. + * @param {Object} bodyParam The value to pass as the request body. + * @param {Array.} authNames An array of authentication type names. + * @param {Array.} contentTypes An array of request MIME types. + * @param {Array.} accepts An array of acceptable response MIME types. + * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the + * constructor for a complex type. + * @param {String} apiBasePath base path defined in the operation/path level to override the default one + * @param {module:ApiClient~callApiCallback} callback The callback function. + * @returns {Object} The SuperAgent request object. + */ + callApi(path, httpMethod, pathParams, + queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + returnType, apiBasePath, callback) { + + var url = this.buildUrl(path, pathParams, apiBasePath); + var request = superagent(httpMethod, url); + + if (this.plugins !== null) { + for (var index in this.plugins) { + if (this.plugins.hasOwnProperty(index)) { + request.use(this.plugins[index]) + } + } + } + + // apply authentications + this.applyAuthToRequest(request, authNames); + + // set query parameters + if (httpMethod.toUpperCase() === 'GET' && this.cache === false) { + queryParams['_'] = new Date().getTime(); + } + + request.query(this.normalizeParams(queryParams)); + + // set header parameters + request.set(this.defaultHeaders).set(this.normalizeParams(headerParams)); + + // set requestAgent if it is set by user + if (this.requestAgent) { + request.agent(this.requestAgent); + } + + // set request timeout + request.timeout(this.timeout); + + var contentType = this.jsonPreferredMime(contentTypes); + if (contentType) { + // Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746) + if(contentType != 'multipart/form-data') { + request.type(contentType); + } + } + + if (contentType === 'application/x-www-form-urlencoded') { + request.send(querystring.stringify(this.normalizeParams(formParams))); + } else if (contentType == 'multipart/form-data') { + var _formParams = this.normalizeParams(formParams); + for (var key in _formParams) { + if (_formParams.hasOwnProperty(key)) { + let _formParamsValue = _formParams[key]; + if (this.isFileParam(_formParamsValue)) { + // file field + request.attach(key, _formParamsValue); + } else if (Array.isArray(_formParamsValue) && _formParamsValue.length + && this.isFileParam(_formParamsValue[0])) { + // multiple files + _formParamsValue.forEach(file => request.attach(key, file)); + } else { + request.field(key, _formParamsValue); + } + } + } + } else if (bodyParam !== null && bodyParam !== undefined) { + if (!request.header['Content-Type']) { + request.type('application/json'); + } + request.send(bodyParam); + } + + var accept = this.jsonPreferredMime(accepts); + if (accept) { + request.accept(accept); + } + + if (returnType === 'Blob') { + request.responseType('blob'); + } else if (returnType === 'String') { + request.responseType('text'); + } + + // Attach previously saved cookies, if enabled + if (this.enableCookies){ + if (typeof window === 'undefined') { + this.agent._attachCookies(request); + } + else { + request.withCredentials(); + } + } + + request.end((error, response) => { + if (callback) { + var data = null; + if (!error) { + try { + data = this.deserialize(response, returnType); + if (this.enableCookies && typeof window === 'undefined'){ + this.agent._saveCookies(response); + } + } catch (err) { + error = err; + } + } + + callback(error, data, response); + } + }); + + return request; + } + + /** + * Parses an ISO-8601 string representation or epoch representation of a date value. + * @param {String} str The date value as a string. + * @returns {Date} The parsed date object. + */ + static parseDate(str) { + if (isNaN(str)) { + return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3')); + } + return new Date(+str); + } + + /** + * Converts a value to the specified type. + * @param {(String|Object)} data The data to convert, as a string or object. + * @param {(String|Array.|Object.|Function)} type The type to return. Pass a string for simple types + * or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To + * return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type: + * all properties on data will be converted to this type. + * @returns An instance of the specified type or null or undefined if data is null or undefined. + */ + static convertToType(data, type) { + if (data === null || data === undefined) + return data + + switch (type) { + case 'Boolean': + return Boolean(data); + case 'Integer': + return parseInt(data, 10); + case 'Number': + return parseFloat(data); + case 'String': + return String(data); + case 'Date': + return ApiClient.parseDate(String(data)); + case 'Blob': + return data; + default: + if (type === Object) { + // generic object, return directly + return data; + } else if (typeof type.constructFromObject === 'function') { + // for model type like User and enum class + return type.constructFromObject(data); + } else if (Array.isArray(type)) { + // for array type like: ['String'] + var itemType = type[0]; + + return data.map((item) => { + return ApiClient.convertToType(item, itemType); + }); + } else if (typeof type === 'object') { + // for plain object type like: {'String': 'Integer'} + var keyType, valueType; + for (var k in type) { + if (type.hasOwnProperty(k)) { + keyType = k; + valueType = type[k]; + break; + } + } + + var result = {}; + for (var k in data) { + if (data.hasOwnProperty(k)) { + var key = ApiClient.convertToType(k, keyType); + var value = ApiClient.convertToType(data[k], valueType); + result[key] = value; + } + } + + return result; + } else { + // for unknown type, return the data directly + return data; + } + } + } + + /** + * Gets an array of host settings + * @returns An array of host settings + */ + hostSettings() { + return [ + { + 'url': "http://localhost:3903/v0", + 'description': "A local server", + } + ]; + } + + getBasePathFromSettings(index, variables={}) { + var servers = this.hostSettings(); + + // check array index out of bound + if (index < 0 || index >= servers.length) { + throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length); + } + + var server = servers[index]; + var url = server['url']; + + // go through variable and assign a value + for (var variable_name in server['variables']) { + if (variable_name in variables) { + let variable = server['variables'][variable_name]; + if ( !('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name]) ) { + url = url.replace("{" + variable_name + "}", variables[variable_name]); + } else { + throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + "."); + } + } else { + // use default value + url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value']) + } + } + return url; + } + + /** + * Constructs a new map or array model from REST data. + * @param data {Object|Array} The REST data. + * @param obj {Object|Array} The target object or array. + */ + static constructFromObject(data, obj, itemType) { + if (Array.isArray(data)) { + for (var i = 0; i < data.length; i++) { + if (data.hasOwnProperty(i)) + obj[i] = ApiClient.convertToType(data[i], itemType); + } + } else { + for (var k in data) { + if (data.hasOwnProperty(k)) + obj[k] = ApiClient.convertToType(data[k], itemType); + } + } + }; +} + +/** + * Enumeration of collection format separator strategies. + * @enum {String} + * @readonly + */ +ApiClient.CollectionFormatEnum = { + /** + * Comma-separated values. Value: csv + * @const + */ + CSV: ',', + + /** + * Space-separated values. Value: ssv + * @const + */ + SSV: ' ', + + /** + * Tab-separated values. Value: tsv + * @const + */ + TSV: '\t', + + /** + * Pipe(|)-separated values. Value: pipes + * @const + */ + PIPES: '|', + + /** + * Native array. Value: multi + * @const + */ + MULTI: 'multi' +}; + +/** +* The default API client implementation. +* @type {module:ApiClient} +*/ +ApiClient.instance = new ApiClient(); +export default ApiClient; diff --git a/src/api/BucketApi.js b/src/api/BucketApi.js new file mode 100644 index 0000000..5abbc9c --- /dev/null +++ b/src/api/BucketApi.js @@ -0,0 +1,589 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 +* @version v0.8.0 +*/ +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; + } + + + /** + * Callback function to receive the result of the allowBucketKey operation. + * @callback module:api/BucketApi~allowBucketKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 + * @param {module:api/BucketApi~allowBucketKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + allowBucketKey(allowBucketKeyRequest, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the createBucket operation. + * @callback module:api/BucketApi~createBucketCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 + * @param {module:api/BucketApi~createBucketCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + createBucket(createBucketRequest, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the deleteBucket operation. + * @callback module:api/BucketApi~deleteBucketCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * 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! + * @param {String} bucketId The exact bucket identifier, a 32 bytes hexadecimal string + * @param {module:api/BucketApi~deleteBucketCallback} callback The callback function, accepting three arguments: error, data, response + */ + deleteBucket(bucketId, callback) { + 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 deleteBucket"); + } + + let pathParams = { + 'bucket_id': bucketId + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/bucket?id={bucket_id}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the deleteBucketGlobalAlias operation. + * @callback module:api/BucketApi~deleteBucketGlobalAliasCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Delete a global alias + * Delete a global alias from the target bucket + * @param {String} id + * @param {String} alias + * @param {module:api/BucketApi~deleteBucketGlobalAliasCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + deleteBucketGlobalAlias(id, alias, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the deleteBucketLocalAlias operation. + * @callback module:api/BucketApi~deleteBucketLocalAliasCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 + * @param {module:api/BucketApi~deleteBucketLocalAliasCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + deleteBucketLocalAlias(id, accessKeyId, alias, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the denyBucketKey operation. + * @callback module:api/BucketApi~denyBucketKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 + * @param {module:api/BucketApi~denyBucketKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + denyBucketKey(allowBucketKeyRequest, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the findBucketInfo operation. + * @callback module:api/BucketApi~findBucketInfoCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Find a bucket + * Find a bucket by its global alias + * @param {String} alias The exact global alias of one of the existing buckets + * @param {module:api/BucketApi~findBucketInfoCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + findBucketInfo(alias, callback) { + 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 = { + 'alias': alias + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = BucketInfo; + return this.apiClient.callApi( + '/bucket?globalAlias={alias}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the getBucketInfo operation. + * @callback module:api/BucketApi~getBucketInfoCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 + * @param {module:api/BucketApi~getBucketInfoCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + getBucketInfo(bucketId, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the listBuckets operation. + * @callback module:api/BucketApi~listBucketsCallback + * @param {String} error Error message, if any. + * @param {Array.} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * List all buckets + * List all the buckets on the cluster with their UUID and their global and local aliases. + * @param {module:api/BucketApi~listBucketsCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link Array.} + */ + listBuckets(callback) { + 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( + '/bucket', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the putBucketGlobalAlias operation. + * @callback module:api/BucketApi~putBucketGlobalAliasCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Add a global alias + * Add a global alias to the target bucket + * @param {String} id + * @param {String} alias + * @param {module:api/BucketApi~putBucketGlobalAliasCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + putBucketGlobalAlias(id, alias, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the putBucketLocalAlias operation. + * @callback module:api/BucketApi~putBucketLocalAliasCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 + * @param {module:api/BucketApi~putBucketLocalAliasCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + putBucketLocalAlias(id, accessKeyId, alias, callback) { + 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, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the updateBucket operation. + * @callback module:api/BucketApi~updateBucketCallback + * @param {String} error Error message, if any. + * @param {module:model/BucketInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Update a bucket + * All fields (`websiteAccess` and `quotas`) are optionnal. 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 {module:model/UpdateBucketRequest} updateBucketRequest Requested changes on the bucket. Both root fields are optionals. + * @param {module:api/BucketApi~updateBucketCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/BucketInfo} + */ + updateBucket(bucketId, updateBucketRequest, callback) { + let postBody = updateBucketRequest; + // verify the required parameter 'bucketId' is set + if (bucketId === undefined || bucketId === null) { + throw new Error("Missing the required parameter 'bucketId' when calling updateBucket"); + } + // 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 = { + 'bucket_id': bucketId + }; + 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?id={bucket_id}', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + +} diff --git a/src/api/KeyApi.js b/src/api/KeyApi.js new file mode 100644 index 0000000..81c2c6a --- /dev/null +++ b/src/api/KeyApi.js @@ -0,0 +1,339 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 AddKeyRequest from '../model/AddKeyRequest'; +import ImportKeyRequest from '../model/ImportKeyRequest'; +import KeyInfo from '../model/KeyInfo'; +import ListKeys200ResponseInner from '../model/ListKeys200ResponseInner'; +import UpdateKeyRequest from '../model/UpdateKeyRequest'; + +/** +* Key service. +* @module api/KeyApi +* @version v0.8.0 +*/ +export default class KeyApi { + + /** + * Constructs a new KeyApi. + * @alias module:api/KeyApi + * @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; + } + + + /** + * Callback function to receive the result of the addKey operation. + * @callback module:api/KeyApi~addKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/KeyInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Create a new API key + * Creates a new API access key. + * @param {module:model/AddKeyRequest} addKeyRequest \"You can set a friendly name for this key, send an empty string instead\" + * @param {module:api/KeyApi~addKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/KeyInfo} + */ + addKey(addKeyRequest, callback) { + let postBody = addKeyRequest; + // verify the required parameter 'addKeyRequest' is set + if (addKeyRequest === undefined || addKeyRequest === null) { + throw new Error("Missing the required parameter 'addKeyRequest' when calling addKey"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = KeyInfo; + return this.apiClient.callApi( + '/key', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the deleteKey operation. + * @callback module:api/KeyApi~deleteKeyCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * 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 {module:api/KeyApi~deleteKeyCallback} callback The callback function, accepting three arguments: error, data, response + */ + deleteKey(accessKey, callback) { + 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"); + } + + let pathParams = { + 'access_key': accessKey + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/key?id={access_key}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the getKey operation. + * @callback module:api/KeyApi~getKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/KeyInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Get key information + * Return information about a specific key and return its information + * @param {String} accessKey The exact API access key generated by Garage + * @param {module:api/KeyApi~getKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/KeyInfo} + */ + getKey(accessKey, callback) { + 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 = { + 'access_key': accessKey + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = KeyInfo; + return this.apiClient.callApi( + '/key?id={access_key}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the importKey operation. + * @callback module:api/KeyApi~importKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/KeyInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Import an existing key + * Imports an existing API key. This feature must only be used for migrations and backup restore. **Do not use it to generate custom key identifiers or you will break your Garage cluster.** + * @param {module:model/ImportKeyRequest} importKeyRequest Information on the key to import + * @param {module:api/KeyApi~importKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/KeyInfo} + */ + importKey(importKeyRequest, callback) { + let postBody = importKeyRequest; + // verify the required parameter 'importKeyRequest' is set + if (importKeyRequest === undefined || importKeyRequest === null) { + throw new Error("Missing the required parameter 'importKeyRequest' when calling importKey"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = KeyInfo; + return this.apiClient.callApi( + '/key/import', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the listKeys operation. + * @callback module:api/KeyApi~listKeysCallback + * @param {String} error Error message, if any. + * @param {Array.} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * List all keys + * Returns all API access keys in the cluster. + * @param {module:api/KeyApi~listKeysCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link Array.} + */ + listKeys(callback) { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = [ListKeys200ResponseInner]; + return this.apiClient.callApi( + '/key', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the searchKey operation. + * @callback module:api/KeyApi~searchKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/KeyInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Select key by pattern + * Find the first key matching the given pattern based on its identifier aor friendly name and return its information. + * @param {String} pattern A pattern (beginning or full string) corresponding to a key identifier or friendly name + * @param {module:api/KeyApi~searchKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/KeyInfo} + */ + searchKey(pattern, callback) { + 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 = { + }; + 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, callback + ); + } + + /** + * Callback function to receive the result of the updateKey operation. + * @callback module:api/KeyApi~updateKeyCallback + * @param {String} error Error message, if any. + * @param {module:model/KeyInfo} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Update a key + * Updates information about the specified API access key. + * @param {String} accessKey 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 + * @param {module:api/KeyApi~updateKeyCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/KeyInfo} + */ + updateKey(accessKey, updateKeyRequest, callback) { + 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 'updateKeyRequest' is set + if (updateKeyRequest === undefined || updateKeyRequest === null) { + throw new Error("Missing the required parameter 'updateKeyRequest' when calling updateKey"); + } + + let pathParams = { + 'access_key': accessKey + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = KeyInfo; + return this.apiClient.callApi( + '/key?id={access_key}', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + +} diff --git a/src/api/LayoutApi.js b/src/api/LayoutApi.js new file mode 100644 index 0000000..13bced8 --- /dev/null +++ b/src/api/LayoutApi.js @@ -0,0 +1,200 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 ClusterLayout from '../model/ClusterLayout'; +import LayoutVersion from '../model/LayoutVersion'; +import NodeClusterInfo from '../model/NodeClusterInfo'; + +/** +* Layout service. +* @module api/LayoutApi +* @version v0.8.0 +*/ +export default class LayoutApi { + + /** + * Constructs a new LayoutApi. + * @alias module:api/LayoutApi + * @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; + } + + + /** + * Callback function to receive the result of the addLayout operation. + * @callback module:api/LayoutApi~addLayoutCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * Send modifications to the cluster layout + * Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of `GET /layout`. Once the set of staged changes is satisfactory, the user may call `POST /layout/apply` to apply the changed changes, or `POST /layout/revert` to clear all of the staged changes in the layout. Note that setting the capacity to `null` will configure the node as a gateway. + * @param {Object.} requestBody To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. + * @param {module:api/LayoutApi~addLayoutCallback} callback The callback function, accepting three arguments: error, data, response + */ + addLayout(requestBody, callback) { + let postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody === undefined || requestBody === null) { + throw new Error("Missing the required parameter 'requestBody' when calling addLayout"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/layout', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the applyLayout operation. + * @callback module:api/LayoutApi~applyLayoutCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * Apply staged layout + * Applies to the cluster the layout changes currently registered as staged layout changes. + * @param {module:model/LayoutVersion} layoutVersion Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. + * @param {module:api/LayoutApi~applyLayoutCallback} callback The callback function, accepting three arguments: error, data, response + */ + applyLayout(layoutVersion, callback) { + let postBody = layoutVersion; + // verify the required parameter 'layoutVersion' is set + if (layoutVersion === undefined || layoutVersion === null) { + throw new Error("Missing the required parameter 'layoutVersion' when calling applyLayout"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/layout/apply', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the getLayout operation. + * @callback module:api/LayoutApi~getLayoutCallback + * @param {String} error Error message, if any. + * @param {module:model/ClusterLayout} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Details on the current and staged layout + * Returns the cluster's current layout, including: - Currently configured cluster layout - Staged changes to the cluster layout *The info returned by this endpoint is a subset of the info returned by `GET /status`.* + * @param {module:api/LayoutApi~getLayoutCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/ClusterLayout} + */ + getLayout(callback) { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = ClusterLayout; + return this.apiClient.callApi( + '/layout', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the revertLayout operation. + * @callback module:api/LayoutApi~revertLayoutCallback + * @param {String} error Error message, if any. + * @param data This operation does not return a value. + * @param {String} response The complete HTTP response. + */ + + /** + * Clear staged layout + * Clears all of the staged layout changes. + * @param {module:model/LayoutVersion} layoutVersion Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster. + * @param {module:api/LayoutApi~revertLayoutCallback} callback The callback function, accepting three arguments: error, data, response + */ + revertLayout(layoutVersion, callback) { + let postBody = layoutVersion; + // verify the required parameter 'layoutVersion' is set + if (layoutVersion === undefined || layoutVersion === null) { + throw new Error("Missing the required parameter 'layoutVersion' when calling revertLayout"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = []; + let returnType = null; + return this.apiClient.callApi( + '/layout/revert', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + +} diff --git a/src/api/NodesApi.js b/src/api/NodesApi.js new file mode 100644 index 0000000..2c53a09 --- /dev/null +++ b/src/api/NodesApi.js @@ -0,0 +1,118 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 AddNode200ResponseInner from '../model/AddNode200ResponseInner'; +import GetNodes200Response from '../model/GetNodes200Response'; + +/** +* Nodes service. +* @module api/NodesApi +* @version v0.8.0 +*/ +export default class NodesApi { + + /** + * Constructs a new NodesApi. + * @alias module:api/NodesApi + * @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; + } + + + /** + * Callback function to receive the result of the addNode operation. + * @callback module:api/NodesApi~addNodeCallback + * @param {String} error Error message, if any. + * @param {Array.} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Connect target node to other Garage nodes + * Instructs this Garage node to connect to other Garage nodes at specified `@`. `node_id` is generated automatically on node start. + * @param {Array.} requestBody + * @param {module:api/NodesApi~addNodeCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link Array.} + */ + addNode(requestBody, callback) { + let postBody = requestBody; + // verify the required parameter 'requestBody' is set + if (requestBody === undefined || requestBody === null) { + throw new Error("Missing the required parameter 'requestBody' when calling addNode"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = [AddNode200ResponseInner]; + return this.apiClient.callApi( + '/connect', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + /** + * Callback function to receive the result of the getNodes operation. + * @callback module:api/NodesApi~getNodesCallback + * @param {String} error Error message, if any. + * @param {module:model/GetNodes200Response} data The data returned by the service call. + * @param {String} response The complete HTTP response. + */ + + /** + * Status of this node and other nodes in the cluster + * Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon - Live nodes - Currently configured cluster layout - Staged changes to the cluster layout + * @param {module:api/NodesApi~getNodesCallback} callback The callback function, accepting three arguments: error, data, response + * data is of type: {@link module:model/GetNodes200Response} + */ + getNodes(callback) { + let postBody = null; + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['bearerAuth']; + let contentTypes = []; + let accepts = ['application/json']; + let returnType = GetNodes200Response; + return this.apiClient.callApi( + '/status', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null, callback + ); + } + + +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..76bb8d3 --- /dev/null +++ b/src/index.js @@ -0,0 +1,293 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 AddKeyRequest from './model/AddKeyRequest'; +import AddNode200ResponseInner from './model/AddNode200ResponseInner'; +import AllowBucketKeyRequest from './model/AllowBucketKeyRequest'; +import AllowBucketKeyRequestPermissions from './model/AllowBucketKeyRequestPermissions'; +import BucketInfo from './model/BucketInfo'; +import BucketInfoQuotas from './model/BucketInfoQuotas'; +import BucketInfoWebsiteConfig from './model/BucketInfoWebsiteConfig'; +import BucketKeyInfo from './model/BucketKeyInfo'; +import ClusterLayout from './model/ClusterLayout'; +import CreateBucketRequest from './model/CreateBucketRequest'; +import CreateBucketRequestLocalAlias from './model/CreateBucketRequestLocalAlias'; +import CreateBucketRequestLocalAliasAllow from './model/CreateBucketRequestLocalAliasAllow'; +import GetNodes200Response from './model/GetNodes200Response'; +import ImportKeyRequest from './model/ImportKeyRequest'; +import KeyInfo from './model/KeyInfo'; +import KeyInfoBucketsInner from './model/KeyInfoBucketsInner'; +import KeyInfoBucketsInnerPermissions from './model/KeyInfoBucketsInnerPermissions'; +import KeyInfoPermissions from './model/KeyInfoPermissions'; +import LayoutVersion from './model/LayoutVersion'; +import ListBuckets200ResponseInner from './model/ListBuckets200ResponseInner'; +import ListBuckets200ResponseInnerLocalAliasesInner from './model/ListBuckets200ResponseInnerLocalAliasesInner'; +import ListKeys200ResponseInner from './model/ListKeys200ResponseInner'; +import NodeClusterInfo from './model/NodeClusterInfo'; +import NodeNetworkInfo from './model/NodeNetworkInfo'; +import UpdateBucketRequest from './model/UpdateBucketRequest'; +import UpdateBucketRequestQuotas from './model/UpdateBucketRequestQuotas'; +import UpdateBucketRequestWebsiteAccess from './model/UpdateBucketRequestWebsiteAccess'; +import UpdateKeyRequest from './model/UpdateKeyRequest'; +import UpdateKeyRequestAllow from './model/UpdateKeyRequestAllow'; +import UpdateKeyRequestDeny from './model/UpdateKeyRequestDeny'; +import BucketApi from './api/BucketApi'; +import KeyApi from './api/KeyApi'; +import LayoutApi from './api/LayoutApi'; +import NodesApi from './api/NodesApi'; + + +/** +* 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!* .
+* The index module provides access to constructors for all the classes which comprise the public API. +*

+* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: +*

+* var garage = require('index'); // See note below*.
+* var xxxSvc = new garage.XxxApi(); // Allocate the API class we're going to use.
+* var yyyModel = new garage.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+* *NOTE: For a top-level AMD script, use require(['index'], function(){...}) +* and put the application logic within the callback function. +*

+*

+* A non-AMD browser application (discouraged) might do something like this: +*

+* var xxxSvc = new garage.XxxApi(); // Allocate the API class we're going to use.
+* var yyy = new garage.Yyy(); // Construct a model instance.
+* yyyModel.someProperty = 'someValue';
+* ...
+* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
+* ...
+* 
+*

+* @module index +* @version v0.8.0 +*/ +export { + /** + * The ApiClient constructor. + * @property {module:ApiClient} + */ + ApiClient, + + /** + * The AddKeyRequest model constructor. + * @property {module:model/AddKeyRequest} + */ + AddKeyRequest, + + /** + * The AddNode200ResponseInner model constructor. + * @property {module:model/AddNode200ResponseInner} + */ + AddNode200ResponseInner, + + /** + * The AllowBucketKeyRequest model constructor. + * @property {module:model/AllowBucketKeyRequest} + */ + AllowBucketKeyRequest, + + /** + * The AllowBucketKeyRequestPermissions model constructor. + * @property {module:model/AllowBucketKeyRequestPermissions} + */ + AllowBucketKeyRequestPermissions, + + /** + * The BucketInfo model constructor. + * @property {module:model/BucketInfo} + */ + BucketInfo, + + /** + * The BucketInfoQuotas model constructor. + * @property {module:model/BucketInfoQuotas} + */ + BucketInfoQuotas, + + /** + * The BucketInfoWebsiteConfig model constructor. + * @property {module:model/BucketInfoWebsiteConfig} + */ + BucketInfoWebsiteConfig, + + /** + * The BucketKeyInfo model constructor. + * @property {module:model/BucketKeyInfo} + */ + BucketKeyInfo, + + /** + * The ClusterLayout model constructor. + * @property {module:model/ClusterLayout} + */ + ClusterLayout, + + /** + * The CreateBucketRequest model constructor. + * @property {module:model/CreateBucketRequest} + */ + CreateBucketRequest, + + /** + * The CreateBucketRequestLocalAlias model constructor. + * @property {module:model/CreateBucketRequestLocalAlias} + */ + CreateBucketRequestLocalAlias, + + /** + * The CreateBucketRequestLocalAliasAllow model constructor. + * @property {module:model/CreateBucketRequestLocalAliasAllow} + */ + CreateBucketRequestLocalAliasAllow, + + /** + * The GetNodes200Response model constructor. + * @property {module:model/GetNodes200Response} + */ + GetNodes200Response, + + /** + * The ImportKeyRequest model constructor. + * @property {module:model/ImportKeyRequest} + */ + ImportKeyRequest, + + /** + * The KeyInfo model constructor. + * @property {module:model/KeyInfo} + */ + KeyInfo, + + /** + * The KeyInfoBucketsInner model constructor. + * @property {module:model/KeyInfoBucketsInner} + */ + KeyInfoBucketsInner, + + /** + * The KeyInfoBucketsInnerPermissions model constructor. + * @property {module:model/KeyInfoBucketsInnerPermissions} + */ + KeyInfoBucketsInnerPermissions, + + /** + * The KeyInfoPermissions model constructor. + * @property {module:model/KeyInfoPermissions} + */ + KeyInfoPermissions, + + /** + * The LayoutVersion model constructor. + * @property {module:model/LayoutVersion} + */ + LayoutVersion, + + /** + * The ListBuckets200ResponseInner model constructor. + * @property {module:model/ListBuckets200ResponseInner} + */ + ListBuckets200ResponseInner, + + /** + * The ListBuckets200ResponseInnerLocalAliasesInner model constructor. + * @property {module:model/ListBuckets200ResponseInnerLocalAliasesInner} + */ + ListBuckets200ResponseInnerLocalAliasesInner, + + /** + * The ListKeys200ResponseInner model constructor. + * @property {module:model/ListKeys200ResponseInner} + */ + ListKeys200ResponseInner, + + /** + * The NodeClusterInfo model constructor. + * @property {module:model/NodeClusterInfo} + */ + NodeClusterInfo, + + /** + * The NodeNetworkInfo model constructor. + * @property {module:model/NodeNetworkInfo} + */ + NodeNetworkInfo, + + /** + * The UpdateBucketRequest model constructor. + * @property {module:model/UpdateBucketRequest} + */ + UpdateBucketRequest, + + /** + * The UpdateBucketRequestQuotas model constructor. + * @property {module:model/UpdateBucketRequestQuotas} + */ + UpdateBucketRequestQuotas, + + /** + * The UpdateBucketRequestWebsiteAccess model constructor. + * @property {module:model/UpdateBucketRequestWebsiteAccess} + */ + UpdateBucketRequestWebsiteAccess, + + /** + * The UpdateKeyRequest model constructor. + * @property {module:model/UpdateKeyRequest} + */ + UpdateKeyRequest, + + /** + * The UpdateKeyRequestAllow model constructor. + * @property {module:model/UpdateKeyRequestAllow} + */ + UpdateKeyRequestAllow, + + /** + * The UpdateKeyRequestDeny model constructor. + * @property {module:model/UpdateKeyRequestDeny} + */ + UpdateKeyRequestDeny, + + /** + * The BucketApi service constructor. + * @property {module:api/BucketApi} + */ + BucketApi, + + /** + * The KeyApi service constructor. + * @property {module:api/KeyApi} + */ + KeyApi, + + /** + * The LayoutApi service constructor. + * @property {module:api/LayoutApi} + */ + LayoutApi, + + /** + * The NodesApi service constructor. + * @property {module:api/NodesApi} + */ + NodesApi +}; diff --git a/src/model/AddKeyRequest.js b/src/model/AddKeyRequest.js new file mode 100644 index 0000000..07edeb3 --- /dev/null +++ b/src/model/AddKeyRequest.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The AddKeyRequest model module. + * @module model/AddKeyRequest + * @version v0.8.0 + */ +class AddKeyRequest { + /** + * Constructs a new AddKeyRequest. + * @alias module:model/AddKeyRequest + */ + constructor() { + + AddKeyRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AddKeyRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AddKeyRequest} obj Optional instance to populate. + * @return {module:model/AddKeyRequest} The populated AddKeyRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AddKeyRequest(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} name + */ +AddKeyRequest.prototype['name'] = undefined; + + + + + + +export default AddKeyRequest; + diff --git a/src/model/AddNode200ResponseInner.js b/src/model/AddNode200ResponseInner.js new file mode 100644 index 0000000..56df484 --- /dev/null +++ b/src/model/AddNode200ResponseInner.js @@ -0,0 +1,79 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The AddNode200ResponseInner model module. + * @module model/AddNode200ResponseInner + * @version v0.8.0 + */ +class AddNode200ResponseInner { + /** + * Constructs a new AddNode200ResponseInner. + * @alias module:model/AddNode200ResponseInner + */ + constructor() { + + AddNode200ResponseInner.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a AddNode200ResponseInner from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AddNode200ResponseInner} obj Optional instance to populate. + * @return {module:model/AddNode200ResponseInner} The populated AddNode200ResponseInner instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AddNode200ResponseInner(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + } + if (data.hasOwnProperty('error')) { + obj['error'] = ApiClient.convertToType(data['error'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +AddNode200ResponseInner.prototype['success'] = undefined; + +/** + * @member {String} error + */ +AddNode200ResponseInner.prototype['error'] = undefined; + + + + + + +export default AddNode200ResponseInner; + diff --git a/src/model/AllowBucketKeyRequest.js b/src/model/AllowBucketKeyRequest.js new file mode 100644 index 0000000..fade968 --- /dev/null +++ b/src/model/AllowBucketKeyRequest.js @@ -0,0 +1,94 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 AllowBucketKeyRequestPermissions from './AllowBucketKeyRequestPermissions'; + +/** + * The AllowBucketKeyRequest model module. + * @module model/AllowBucketKeyRequest + * @version v0.8.0 + */ +class AllowBucketKeyRequest { + /** + * Constructs a new AllowBucketKeyRequest. + * @alias module:model/AllowBucketKeyRequest + * @param bucketId {String} + * @param accessKeyId {String} + * @param permissions {module:model/AllowBucketKeyRequestPermissions} + */ + constructor(bucketId, accessKeyId, permissions) { + + AllowBucketKeyRequest.initialize(this, bucketId, accessKeyId, permissions); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, bucketId, accessKeyId, permissions) { + obj['bucketId'] = bucketId; + obj['accessKeyId'] = accessKeyId; + obj['permissions'] = permissions; + } + + /** + * Constructs a AllowBucketKeyRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AllowBucketKeyRequest} obj Optional instance to populate. + * @return {module:model/AllowBucketKeyRequest} The populated AllowBucketKeyRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AllowBucketKeyRequest(); + + if (data.hasOwnProperty('bucketId')) { + obj['bucketId'] = ApiClient.convertToType(data['bucketId'], 'String'); + } + if (data.hasOwnProperty('accessKeyId')) { + obj['accessKeyId'] = ApiClient.convertToType(data['accessKeyId'], 'String'); + } + if (data.hasOwnProperty('permissions')) { + obj['permissions'] = AllowBucketKeyRequestPermissions.constructFromObject(data['permissions']); + } + } + return obj; + } + + +} + +/** + * @member {String} bucketId + */ +AllowBucketKeyRequest.prototype['bucketId'] = undefined; + +/** + * @member {String} accessKeyId + */ +AllowBucketKeyRequest.prototype['accessKeyId'] = undefined; + +/** + * @member {module:model/AllowBucketKeyRequestPermissions} permissions + */ +AllowBucketKeyRequest.prototype['permissions'] = undefined; + + + + + + +export default AllowBucketKeyRequest; + diff --git a/src/model/AllowBucketKeyRequestPermissions.js b/src/model/AllowBucketKeyRequestPermissions.js new file mode 100644 index 0000000..e478375 --- /dev/null +++ b/src/model/AllowBucketKeyRequestPermissions.js @@ -0,0 +1,93 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The AllowBucketKeyRequestPermissions model module. + * @module model/AllowBucketKeyRequestPermissions + * @version v0.8.0 + */ +class AllowBucketKeyRequestPermissions { + /** + * Constructs a new AllowBucketKeyRequestPermissions. + * @alias module:model/AllowBucketKeyRequestPermissions + * @param read {Boolean} + * @param write {Boolean} + * @param owner {Boolean} + */ + constructor(read, write, owner) { + + AllowBucketKeyRequestPermissions.initialize(this, read, write, owner); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, read, write, owner) { + obj['read'] = read; + obj['write'] = write; + obj['owner'] = owner; + } + + /** + * Constructs a AllowBucketKeyRequestPermissions from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/AllowBucketKeyRequestPermissions} obj Optional instance to populate. + * @return {module:model/AllowBucketKeyRequestPermissions} The populated AllowBucketKeyRequestPermissions instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new AllowBucketKeyRequestPermissions(); + + if (data.hasOwnProperty('read')) { + obj['read'] = ApiClient.convertToType(data['read'], 'Boolean'); + } + if (data.hasOwnProperty('write')) { + obj['write'] = ApiClient.convertToType(data['write'], 'Boolean'); + } + if (data.hasOwnProperty('owner')) { + obj['owner'] = ApiClient.convertToType(data['owner'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} read + */ +AllowBucketKeyRequestPermissions.prototype['read'] = undefined; + +/** + * @member {Boolean} write + */ +AllowBucketKeyRequestPermissions.prototype['write'] = undefined; + +/** + * @member {Boolean} owner + */ +AllowBucketKeyRequestPermissions.prototype['owner'] = undefined; + + + + + + +export default AllowBucketKeyRequestPermissions; + diff --git a/src/model/BucketInfo.js b/src/model/BucketInfo.js new file mode 100644 index 0000000..fae6a1d --- /dev/null +++ b/src/model/BucketInfo.js @@ -0,0 +1,138 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 BucketInfoQuotas from './BucketInfoQuotas'; +import BucketInfoWebsiteConfig from './BucketInfoWebsiteConfig'; +import BucketKeyInfo from './BucketKeyInfo'; + +/** + * The BucketInfo model module. + * @module model/BucketInfo + * @version v0.8.0 + */ +class BucketInfo { + /** + * Constructs a new BucketInfo. + * @alias module:model/BucketInfo + */ + constructor() { + + BucketInfo.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BucketInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BucketInfo} obj Optional instance to populate. + * @return {module:model/BucketInfo} The populated BucketInfo instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BucketInfo(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('globalAliases')) { + obj['globalAliases'] = ApiClient.convertToType(data['globalAliases'], ['String']); + } + if (data.hasOwnProperty('websiteAccess')) { + obj['websiteAccess'] = ApiClient.convertToType(data['websiteAccess'], 'Boolean'); + } + if (data.hasOwnProperty('websiteConfig')) { + obj['websiteConfig'] = BucketInfoWebsiteConfig.constructFromObject(data['websiteConfig']); + } + if (data.hasOwnProperty('keys')) { + obj['keys'] = ApiClient.convertToType(data['keys'], [BucketKeyInfo]); + } + if (data.hasOwnProperty('objects')) { + obj['objects'] = ApiClient.convertToType(data['objects'], 'Number'); + } + if (data.hasOwnProperty('bytes')) { + obj['bytes'] = ApiClient.convertToType(data['bytes'], 'Number'); + } + if (data.hasOwnProperty('unfinishedUploads')) { + obj['unfinishedUploads'] = ApiClient.convertToType(data['unfinishedUploads'], 'Number'); + } + if (data.hasOwnProperty('quotas')) { + obj['quotas'] = BucketInfoQuotas.constructFromObject(data['quotas']); + } + } + return obj; + } + + +} + +/** + * @member {String} id + */ +BucketInfo.prototype['id'] = undefined; + +/** + * @member {Array.} globalAliases + */ +BucketInfo.prototype['globalAliases'] = undefined; + +/** + * @member {Boolean} websiteAccess + */ +BucketInfo.prototype['websiteAccess'] = undefined; + +/** + * @member {module:model/BucketInfoWebsiteConfig} websiteConfig + */ +BucketInfo.prototype['websiteConfig'] = undefined; + +/** + * @member {Array.} keys + */ +BucketInfo.prototype['keys'] = undefined; + +/** + * @member {Number} objects + */ +BucketInfo.prototype['objects'] = undefined; + +/** + * @member {Number} bytes + */ +BucketInfo.prototype['bytes'] = undefined; + +/** + * @member {Number} unfinishedUploads + */ +BucketInfo.prototype['unfinishedUploads'] = undefined; + +/** + * @member {module:model/BucketInfoQuotas} quotas + */ +BucketInfo.prototype['quotas'] = undefined; + + + + + + +export default BucketInfo; + diff --git a/src/model/BucketInfoQuotas.js b/src/model/BucketInfoQuotas.js new file mode 100644 index 0000000..20ee780 --- /dev/null +++ b/src/model/BucketInfoQuotas.js @@ -0,0 +1,79 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The BucketInfoQuotas model module. + * @module model/BucketInfoQuotas + * @version v0.8.0 + */ +class BucketInfoQuotas { + /** + * Constructs a new BucketInfoQuotas. + * @alias module:model/BucketInfoQuotas + */ + constructor() { + + BucketInfoQuotas.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BucketInfoQuotas from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BucketInfoQuotas} obj Optional instance to populate. + * @return {module:model/BucketInfoQuotas} The populated BucketInfoQuotas instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BucketInfoQuotas(); + + if (data.hasOwnProperty('maxSize')) { + obj['maxSize'] = ApiClient.convertToType(data['maxSize'], 'Number'); + } + if (data.hasOwnProperty('maxObjects')) { + obj['maxObjects'] = ApiClient.convertToType(data['maxObjects'], 'Number'); + } + } + return obj; + } + + +} + +/** + * @member {Number} maxSize + */ +BucketInfoQuotas.prototype['maxSize'] = undefined; + +/** + * @member {Number} maxObjects + */ +BucketInfoQuotas.prototype['maxObjects'] = undefined; + + + + + + +export default BucketInfoQuotas; + diff --git a/src/model/BucketInfoWebsiteConfig.js b/src/model/BucketInfoWebsiteConfig.js new file mode 100644 index 0000000..ff65bc1 --- /dev/null +++ b/src/model/BucketInfoWebsiteConfig.js @@ -0,0 +1,79 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The BucketInfoWebsiteConfig model module. + * @module model/BucketInfoWebsiteConfig + * @version v0.8.0 + */ +class BucketInfoWebsiteConfig { + /** + * Constructs a new BucketInfoWebsiteConfig. + * @alias module:model/BucketInfoWebsiteConfig + */ + constructor() { + + BucketInfoWebsiteConfig.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BucketInfoWebsiteConfig from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BucketInfoWebsiteConfig} obj Optional instance to populate. + * @return {module:model/BucketInfoWebsiteConfig} The populated BucketInfoWebsiteConfig instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BucketInfoWebsiteConfig(); + + if (data.hasOwnProperty('indexDocument')) { + obj['indexDocument'] = ApiClient.convertToType(data['indexDocument'], 'String'); + } + if (data.hasOwnProperty('errorDocument')) { + obj['errorDocument'] = ApiClient.convertToType(data['errorDocument'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} indexDocument + */ +BucketInfoWebsiteConfig.prototype['indexDocument'] = undefined; + +/** + * @member {String} errorDocument + */ +BucketInfoWebsiteConfig.prototype['errorDocument'] = undefined; + + + + + + +export default BucketInfoWebsiteConfig; + diff --git a/src/model/BucketKeyInfo.js b/src/model/BucketKeyInfo.js new file mode 100644 index 0000000..1275ee5 --- /dev/null +++ b/src/model/BucketKeyInfo.js @@ -0,0 +1,96 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 CreateBucketRequestLocalAliasAllow from './CreateBucketRequestLocalAliasAllow'; + +/** + * The BucketKeyInfo model module. + * @module model/BucketKeyInfo + * @version v0.8.0 + */ +class BucketKeyInfo { + /** + * Constructs a new BucketKeyInfo. + * @alias module:model/BucketKeyInfo + */ + constructor() { + + BucketKeyInfo.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a BucketKeyInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/BucketKeyInfo} obj Optional instance to populate. + * @return {module:model/BucketKeyInfo} The populated BucketKeyInfo instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new BucketKeyInfo(); + + if (data.hasOwnProperty('accessKeyId')) { + obj['accessKeyId'] = ApiClient.convertToType(data['accessKeyId'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('permissions')) { + obj['permissions'] = CreateBucketRequestLocalAliasAllow.constructFromObject(data['permissions']); + } + if (data.hasOwnProperty('bucketLocalAliases')) { + obj['bucketLocalAliases'] = ApiClient.convertToType(data['bucketLocalAliases'], ['String']); + } + } + return obj; + } + + +} + +/** + * @member {String} accessKeyId + */ +BucketKeyInfo.prototype['accessKeyId'] = undefined; + +/** + * @member {String} name + */ +BucketKeyInfo.prototype['name'] = undefined; + +/** + * @member {module:model/CreateBucketRequestLocalAliasAllow} permissions + */ +BucketKeyInfo.prototype['permissions'] = undefined; + +/** + * @member {Array.} bucketLocalAliases + */ +BucketKeyInfo.prototype['bucketLocalAliases'] = undefined; + + + + + + +export default BucketKeyInfo; + diff --git a/src/model/ClusterLayout.js b/src/model/ClusterLayout.js new file mode 100644 index 0000000..c4d4961 --- /dev/null +++ b/src/model/ClusterLayout.js @@ -0,0 +1,94 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 NodeClusterInfo from './NodeClusterInfo'; + +/** + * The ClusterLayout model module. + * @module model/ClusterLayout + * @version v0.8.0 + */ +class ClusterLayout { + /** + * Constructs a new ClusterLayout. + * @alias module:model/ClusterLayout + * @param version {Number} + * @param roles {Object.} + * @param stagedRoleChanges {Object.} + */ + constructor(version, roles, stagedRoleChanges) { + + ClusterLayout.initialize(this, version, roles, stagedRoleChanges); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, version, roles, stagedRoleChanges) { + obj['version'] = version; + obj['roles'] = roles; + obj['stagedRoleChanges'] = stagedRoleChanges; + } + + /** + * Constructs a ClusterLayout from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ClusterLayout} obj Optional instance to populate. + * @return {module:model/ClusterLayout} The populated ClusterLayout instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ClusterLayout(); + + if (data.hasOwnProperty('version')) { + obj['version'] = ApiClient.convertToType(data['version'], 'Number'); + } + if (data.hasOwnProperty('roles')) { + obj['roles'] = ApiClient.convertToType(data['roles'], {'String': NodeClusterInfo}); + } + if (data.hasOwnProperty('stagedRoleChanges')) { + obj['stagedRoleChanges'] = ApiClient.convertToType(data['stagedRoleChanges'], {'String': NodeClusterInfo}); + } + } + return obj; + } + + +} + +/** + * @member {Number} version + */ +ClusterLayout.prototype['version'] = undefined; + +/** + * @member {Object.} roles + */ +ClusterLayout.prototype['roles'] = undefined; + +/** + * @member {Object.} stagedRoleChanges + */ +ClusterLayout.prototype['stagedRoleChanges'] = undefined; + + + + + + +export default ClusterLayout; + diff --git a/src/model/CreateBucketRequest.js b/src/model/CreateBucketRequest.js new file mode 100644 index 0000000..bf45a1a --- /dev/null +++ b/src/model/CreateBucketRequest.js @@ -0,0 +1,80 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 CreateBucketRequestLocalAlias from './CreateBucketRequestLocalAlias'; + +/** + * The CreateBucketRequest model module. + * @module model/CreateBucketRequest + * @version v0.8.0 + */ +class CreateBucketRequest { + /** + * Constructs a new CreateBucketRequest. + * @alias module:model/CreateBucketRequest + */ + constructor() { + + CreateBucketRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a CreateBucketRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/CreateBucketRequest} obj Optional instance to populate. + * @return {module:model/CreateBucketRequest} The populated CreateBucketRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CreateBucketRequest(); + + if (data.hasOwnProperty('globalAlias')) { + obj['globalAlias'] = ApiClient.convertToType(data['globalAlias'], 'String'); + } + if (data.hasOwnProperty('localAlias')) { + obj['localAlias'] = CreateBucketRequestLocalAlias.constructFromObject(data['localAlias']); + } + } + return obj; + } + + +} + +/** + * @member {String} globalAlias + */ +CreateBucketRequest.prototype['globalAlias'] = undefined; + +/** + * @member {module:model/CreateBucketRequestLocalAlias} localAlias + */ +CreateBucketRequest.prototype['localAlias'] = undefined; + + + + + + +export default CreateBucketRequest; + diff --git a/src/model/CreateBucketRequestLocalAlias.js b/src/model/CreateBucketRequestLocalAlias.js new file mode 100644 index 0000000..00c6e7d --- /dev/null +++ b/src/model/CreateBucketRequestLocalAlias.js @@ -0,0 +1,88 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 CreateBucketRequestLocalAliasAllow from './CreateBucketRequestLocalAliasAllow'; + +/** + * The CreateBucketRequestLocalAlias model module. + * @module model/CreateBucketRequestLocalAlias + * @version v0.8.0 + */ +class CreateBucketRequestLocalAlias { + /** + * Constructs a new CreateBucketRequestLocalAlias. + * @alias module:model/CreateBucketRequestLocalAlias + */ + constructor() { + + CreateBucketRequestLocalAlias.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a CreateBucketRequestLocalAlias from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/CreateBucketRequestLocalAlias} obj Optional instance to populate. + * @return {module:model/CreateBucketRequestLocalAlias} The populated CreateBucketRequestLocalAlias instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CreateBucketRequestLocalAlias(); + + if (data.hasOwnProperty('accessKeyId')) { + obj['accessKeyId'] = ApiClient.convertToType(data['accessKeyId'], 'String'); + } + if (data.hasOwnProperty('alias')) { + obj['alias'] = ApiClient.convertToType(data['alias'], 'String'); + } + if (data.hasOwnProperty('allow')) { + obj['allow'] = CreateBucketRequestLocalAliasAllow.constructFromObject(data['allow']); + } + } + return obj; + } + + +} + +/** + * @member {String} accessKeyId + */ +CreateBucketRequestLocalAlias.prototype['accessKeyId'] = undefined; + +/** + * @member {String} alias + */ +CreateBucketRequestLocalAlias.prototype['alias'] = undefined; + +/** + * @member {module:model/CreateBucketRequestLocalAliasAllow} allow + */ +CreateBucketRequestLocalAlias.prototype['allow'] = undefined; + + + + + + +export default CreateBucketRequestLocalAlias; + diff --git a/src/model/CreateBucketRequestLocalAliasAllow.js b/src/model/CreateBucketRequestLocalAliasAllow.js new file mode 100644 index 0000000..b7888ed --- /dev/null +++ b/src/model/CreateBucketRequestLocalAliasAllow.js @@ -0,0 +1,87 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The CreateBucketRequestLocalAliasAllow model module. + * @module model/CreateBucketRequestLocalAliasAllow + * @version v0.8.0 + */ +class CreateBucketRequestLocalAliasAllow { + /** + * Constructs a new CreateBucketRequestLocalAliasAllow. + * @alias module:model/CreateBucketRequestLocalAliasAllow + */ + constructor() { + + CreateBucketRequestLocalAliasAllow.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a CreateBucketRequestLocalAliasAllow from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/CreateBucketRequestLocalAliasAllow} obj Optional instance to populate. + * @return {module:model/CreateBucketRequestLocalAliasAllow} The populated CreateBucketRequestLocalAliasAllow instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CreateBucketRequestLocalAliasAllow(); + + if (data.hasOwnProperty('read')) { + obj['read'] = ApiClient.convertToType(data['read'], 'Boolean'); + } + if (data.hasOwnProperty('write')) { + obj['write'] = ApiClient.convertToType(data['write'], 'Boolean'); + } + if (data.hasOwnProperty('owner')) { + obj['owner'] = ApiClient.convertToType(data['owner'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} read + */ +CreateBucketRequestLocalAliasAllow.prototype['read'] = undefined; + +/** + * @member {Boolean} write + */ +CreateBucketRequestLocalAliasAllow.prototype['write'] = undefined; + +/** + * @member {Boolean} owner + */ +CreateBucketRequestLocalAliasAllow.prototype['owner'] = undefined; + + + + + + +export default CreateBucketRequestLocalAliasAllow; + diff --git a/src/model/GetNodes200Response.js b/src/model/GetNodes200Response.js new file mode 100644 index 0000000..a00d797 --- /dev/null +++ b/src/model/GetNodes200Response.js @@ -0,0 +1,105 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 ClusterLayout from './ClusterLayout'; +import NodeNetworkInfo from './NodeNetworkInfo'; + +/** + * The GetNodes200Response model module. + * @module model/GetNodes200Response + * @version v0.8.0 + */ +class GetNodes200Response { + /** + * Constructs a new GetNodes200Response. + * @alias module:model/GetNodes200Response + * @param node {String} + * @param garageVersion {String} + * @param knownNodes {Object.} + * @param layout {module:model/ClusterLayout} + */ + constructor(node, garageVersion, knownNodes, layout) { + + GetNodes200Response.initialize(this, node, garageVersion, knownNodes, layout); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, node, garageVersion, knownNodes, layout) { + obj['node'] = node; + obj['garageVersion'] = garageVersion; + obj['knownNodes'] = knownNodes; + obj['layout'] = layout; + } + + /** + * Constructs a GetNodes200Response from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/GetNodes200Response} obj Optional instance to populate. + * @return {module:model/GetNodes200Response} The populated GetNodes200Response instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new GetNodes200Response(); + + if (data.hasOwnProperty('node')) { + obj['node'] = ApiClient.convertToType(data['node'], 'String'); + } + if (data.hasOwnProperty('garageVersion')) { + obj['garageVersion'] = ApiClient.convertToType(data['garageVersion'], 'String'); + } + if (data.hasOwnProperty('knownNodes')) { + obj['knownNodes'] = ApiClient.convertToType(data['knownNodes'], {'String': NodeNetworkInfo}); + } + if (data.hasOwnProperty('layout')) { + obj['layout'] = ClusterLayout.constructFromObject(data['layout']); + } + } + return obj; + } + + +} + +/** + * @member {String} node + */ +GetNodes200Response.prototype['node'] = undefined; + +/** + * @member {String} garageVersion + */ +GetNodes200Response.prototype['garageVersion'] = undefined; + +/** + * @member {Object.} knownNodes + */ +GetNodes200Response.prototype['knownNodes'] = undefined; + +/** + * @member {module:model/ClusterLayout} layout + */ +GetNodes200Response.prototype['layout'] = undefined; + + + + + + +export default GetNodes200Response; + diff --git a/src/model/ImportKeyRequest.js b/src/model/ImportKeyRequest.js new file mode 100644 index 0000000..128c0e5 --- /dev/null +++ b/src/model/ImportKeyRequest.js @@ -0,0 +1,93 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The ImportKeyRequest model module. + * @module model/ImportKeyRequest + * @version v0.8.0 + */ +class ImportKeyRequest { + /** + * Constructs a new ImportKeyRequest. + * @alias module:model/ImportKeyRequest + * @param name {String} + * @param accessKeyId {String} + * @param secretAccessKey {String} + */ + constructor(name, accessKeyId, secretAccessKey) { + + ImportKeyRequest.initialize(this, name, accessKeyId, secretAccessKey); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, accessKeyId, secretAccessKey) { + obj['name'] = name; + obj['accessKeyId'] = accessKeyId; + obj['secretAccessKey'] = secretAccessKey; + } + + /** + * Constructs a ImportKeyRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ImportKeyRequest} obj Optional instance to populate. + * @return {module:model/ImportKeyRequest} The populated ImportKeyRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ImportKeyRequest(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('accessKeyId')) { + obj['accessKeyId'] = ApiClient.convertToType(data['accessKeyId'], 'String'); + } + if (data.hasOwnProperty('secretAccessKey')) { + obj['secretAccessKey'] = ApiClient.convertToType(data['secretAccessKey'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} name + */ +ImportKeyRequest.prototype['name'] = undefined; + +/** + * @member {String} accessKeyId + */ +ImportKeyRequest.prototype['accessKeyId'] = undefined; + +/** + * @member {String} secretAccessKey + */ +ImportKeyRequest.prototype['secretAccessKey'] = undefined; + + + + + + +export default ImportKeyRequest; + diff --git a/src/model/KeyInfo.js b/src/model/KeyInfo.js new file mode 100644 index 0000000..de2d7d8 --- /dev/null +++ b/src/model/KeyInfo.js @@ -0,0 +1,105 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 KeyInfoBucketsInner from './KeyInfoBucketsInner'; +import KeyInfoPermissions from './KeyInfoPermissions'; + +/** + * The KeyInfo model module. + * @module model/KeyInfo + * @version v0.8.0 + */ +class KeyInfo { + /** + * Constructs a new KeyInfo. + * @alias module:model/KeyInfo + */ + constructor() { + + KeyInfo.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a KeyInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/KeyInfo} obj Optional instance to populate. + * @return {module:model/KeyInfo} The populated KeyInfo instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new KeyInfo(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('accessKeyId')) { + obj['accessKeyId'] = ApiClient.convertToType(data['accessKeyId'], 'String'); + } + if (data.hasOwnProperty('secretAccessKey')) { + obj['secretAccessKey'] = ApiClient.convertToType(data['secretAccessKey'], 'String'); + } + if (data.hasOwnProperty('permissions')) { + obj['permissions'] = KeyInfoPermissions.constructFromObject(data['permissions']); + } + if (data.hasOwnProperty('buckets')) { + obj['buckets'] = ApiClient.convertToType(data['buckets'], [KeyInfoBucketsInner]); + } + } + return obj; + } + + +} + +/** + * @member {String} name + */ +KeyInfo.prototype['name'] = undefined; + +/** + * @member {String} accessKeyId + */ +KeyInfo.prototype['accessKeyId'] = undefined; + +/** + * @member {String} secretAccessKey + */ +KeyInfo.prototype['secretAccessKey'] = undefined; + +/** + * @member {module:model/KeyInfoPermissions} permissions + */ +KeyInfo.prototype['permissions'] = undefined; + +/** + * @member {Array.} buckets + */ +KeyInfo.prototype['buckets'] = undefined; + + + + + + +export default KeyInfo; + diff --git a/src/model/KeyInfoBucketsInner.js b/src/model/KeyInfoBucketsInner.js new file mode 100644 index 0000000..0d8f8af --- /dev/null +++ b/src/model/KeyInfoBucketsInner.js @@ -0,0 +1,96 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 KeyInfoBucketsInnerPermissions from './KeyInfoBucketsInnerPermissions'; + +/** + * The KeyInfoBucketsInner model module. + * @module model/KeyInfoBucketsInner + * @version v0.8.0 + */ +class KeyInfoBucketsInner { + /** + * Constructs a new KeyInfoBucketsInner. + * @alias module:model/KeyInfoBucketsInner + */ + constructor() { + + KeyInfoBucketsInner.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a KeyInfoBucketsInner from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/KeyInfoBucketsInner} obj Optional instance to populate. + * @return {module:model/KeyInfoBucketsInner} The populated KeyInfoBucketsInner instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new KeyInfoBucketsInner(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('globalAliases')) { + obj['globalAliases'] = ApiClient.convertToType(data['globalAliases'], ['String']); + } + if (data.hasOwnProperty('localAliases')) { + obj['localAliases'] = ApiClient.convertToType(data['localAliases'], ['String']); + } + if (data.hasOwnProperty('permissions')) { + obj['permissions'] = KeyInfoBucketsInnerPermissions.constructFromObject(data['permissions']); + } + } + return obj; + } + + +} + +/** + * @member {String} id + */ +KeyInfoBucketsInner.prototype['id'] = undefined; + +/** + * @member {Array.} globalAliases + */ +KeyInfoBucketsInner.prototype['globalAliases'] = undefined; + +/** + * @member {Array.} localAliases + */ +KeyInfoBucketsInner.prototype['localAliases'] = undefined; + +/** + * @member {module:model/KeyInfoBucketsInnerPermissions} permissions + */ +KeyInfoBucketsInner.prototype['permissions'] = undefined; + + + + + + +export default KeyInfoBucketsInner; + diff --git a/src/model/KeyInfoBucketsInnerPermissions.js b/src/model/KeyInfoBucketsInnerPermissions.js new file mode 100644 index 0000000..0894689 --- /dev/null +++ b/src/model/KeyInfoBucketsInnerPermissions.js @@ -0,0 +1,87 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The KeyInfoBucketsInnerPermissions model module. + * @module model/KeyInfoBucketsInnerPermissions + * @version v0.8.0 + */ +class KeyInfoBucketsInnerPermissions { + /** + * Constructs a new KeyInfoBucketsInnerPermissions. + * @alias module:model/KeyInfoBucketsInnerPermissions + */ + constructor() { + + KeyInfoBucketsInnerPermissions.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a KeyInfoBucketsInnerPermissions from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/KeyInfoBucketsInnerPermissions} obj Optional instance to populate. + * @return {module:model/KeyInfoBucketsInnerPermissions} The populated KeyInfoBucketsInnerPermissions instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new KeyInfoBucketsInnerPermissions(); + + if (data.hasOwnProperty('read')) { + obj['read'] = ApiClient.convertToType(data['read'], 'Boolean'); + } + if (data.hasOwnProperty('write')) { + obj['write'] = ApiClient.convertToType(data['write'], 'Boolean'); + } + if (data.hasOwnProperty('owner')) { + obj['owner'] = ApiClient.convertToType(data['owner'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} read + */ +KeyInfoBucketsInnerPermissions.prototype['read'] = undefined; + +/** + * @member {Boolean} write + */ +KeyInfoBucketsInnerPermissions.prototype['write'] = undefined; + +/** + * @member {Boolean} owner + */ +KeyInfoBucketsInnerPermissions.prototype['owner'] = undefined; + + + + + + +export default KeyInfoBucketsInnerPermissions; + diff --git a/src/model/KeyInfoPermissions.js b/src/model/KeyInfoPermissions.js new file mode 100644 index 0000000..5ba0016 --- /dev/null +++ b/src/model/KeyInfoPermissions.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The KeyInfoPermissions model module. + * @module model/KeyInfoPermissions + * @version v0.8.0 + */ +class KeyInfoPermissions { + /** + * Constructs a new KeyInfoPermissions. + * @alias module:model/KeyInfoPermissions + */ + constructor() { + + KeyInfoPermissions.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a KeyInfoPermissions from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/KeyInfoPermissions} obj Optional instance to populate. + * @return {module:model/KeyInfoPermissions} The populated KeyInfoPermissions instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new KeyInfoPermissions(); + + if (data.hasOwnProperty('createBucket')) { + obj['createBucket'] = ApiClient.convertToType(data['createBucket'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} createBucket + */ +KeyInfoPermissions.prototype['createBucket'] = undefined; + + + + + + +export default KeyInfoPermissions; + diff --git a/src/model/LayoutVersion.js b/src/model/LayoutVersion.js new file mode 100644 index 0000000..36e4a4c --- /dev/null +++ b/src/model/LayoutVersion.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The LayoutVersion model module. + * @module model/LayoutVersion + * @version v0.8.0 + */ +class LayoutVersion { + /** + * Constructs a new LayoutVersion. + * @alias module:model/LayoutVersion + */ + constructor() { + + LayoutVersion.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a LayoutVersion from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/LayoutVersion} obj Optional instance to populate. + * @return {module:model/LayoutVersion} The populated LayoutVersion instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new LayoutVersion(); + + if (data.hasOwnProperty('version')) { + obj['version'] = ApiClient.convertToType(data['version'], 'Number'); + } + } + return obj; + } + + +} + +/** + * @member {Number} version + */ +LayoutVersion.prototype['version'] = undefined; + + + + + + +export default LayoutVersion; + diff --git a/src/model/ListBuckets200ResponseInner.js b/src/model/ListBuckets200ResponseInner.js new file mode 100644 index 0000000..ef9668e --- /dev/null +++ b/src/model/ListBuckets200ResponseInner.js @@ -0,0 +1,90 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 ListBuckets200ResponseInnerLocalAliasesInner from './ListBuckets200ResponseInnerLocalAliasesInner'; + +/** + * The ListBuckets200ResponseInner model module. + * @module model/ListBuckets200ResponseInner + * @version v0.8.0 + */ +class ListBuckets200ResponseInner { + /** + * Constructs a new ListBuckets200ResponseInner. + * @alias module:model/ListBuckets200ResponseInner + * @param id {String} + */ + constructor(id) { + + ListBuckets200ResponseInner.initialize(this, id); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, id) { + obj['id'] = id; + } + + /** + * Constructs a ListBuckets200ResponseInner from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ListBuckets200ResponseInner} obj Optional instance to populate. + * @return {module:model/ListBuckets200ResponseInner} The populated ListBuckets200ResponseInner instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ListBuckets200ResponseInner(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('globalAliases')) { + obj['globalAliases'] = ApiClient.convertToType(data['globalAliases'], ['String']); + } + if (data.hasOwnProperty('localAliases')) { + obj['localAliases'] = ApiClient.convertToType(data['localAliases'], [ListBuckets200ResponseInnerLocalAliasesInner]); + } + } + return obj; + } + + +} + +/** + * @member {String} id + */ +ListBuckets200ResponseInner.prototype['id'] = undefined; + +/** + * @member {Array.} globalAliases + */ +ListBuckets200ResponseInner.prototype['globalAliases'] = undefined; + +/** + * @member {Array.} localAliases + */ +ListBuckets200ResponseInner.prototype['localAliases'] = undefined; + + + + + + +export default ListBuckets200ResponseInner; + diff --git a/src/model/ListBuckets200ResponseInnerLocalAliasesInner.js b/src/model/ListBuckets200ResponseInnerLocalAliasesInner.js new file mode 100644 index 0000000..e04921c --- /dev/null +++ b/src/model/ListBuckets200ResponseInnerLocalAliasesInner.js @@ -0,0 +1,83 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The ListBuckets200ResponseInnerLocalAliasesInner model module. + * @module model/ListBuckets200ResponseInnerLocalAliasesInner + * @version v0.8.0 + */ +class ListBuckets200ResponseInnerLocalAliasesInner { + /** + * Constructs a new ListBuckets200ResponseInnerLocalAliasesInner. + * @alias module:model/ListBuckets200ResponseInnerLocalAliasesInner + * @param alias {String} + * @param accessKeyId {String} + */ + constructor(alias, accessKeyId) { + + ListBuckets200ResponseInnerLocalAliasesInner.initialize(this, alias, accessKeyId); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, alias, accessKeyId) { + obj['alias'] = alias; + obj['accessKeyId'] = accessKeyId; + } + + /** + * Constructs a ListBuckets200ResponseInnerLocalAliasesInner from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ListBuckets200ResponseInnerLocalAliasesInner} obj Optional instance to populate. + * @return {module:model/ListBuckets200ResponseInnerLocalAliasesInner} The populated ListBuckets200ResponseInnerLocalAliasesInner instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ListBuckets200ResponseInnerLocalAliasesInner(); + + if (data.hasOwnProperty('alias')) { + obj['alias'] = ApiClient.convertToType(data['alias'], 'String'); + } + if (data.hasOwnProperty('accessKeyId')) { + obj['accessKeyId'] = ApiClient.convertToType(data['accessKeyId'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} alias + */ +ListBuckets200ResponseInnerLocalAliasesInner.prototype['alias'] = undefined; + +/** + * @member {String} accessKeyId + */ +ListBuckets200ResponseInnerLocalAliasesInner.prototype['accessKeyId'] = undefined; + + + + + + +export default ListBuckets200ResponseInnerLocalAliasesInner; + diff --git a/src/model/ListKeys200ResponseInner.js b/src/model/ListKeys200ResponseInner.js new file mode 100644 index 0000000..b1ab612 --- /dev/null +++ b/src/model/ListKeys200ResponseInner.js @@ -0,0 +1,81 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The ListKeys200ResponseInner model module. + * @module model/ListKeys200ResponseInner + * @version v0.8.0 + */ +class ListKeys200ResponseInner { + /** + * Constructs a new ListKeys200ResponseInner. + * @alias module:model/ListKeys200ResponseInner + * @param id {String} + */ + constructor(id) { + + ListKeys200ResponseInner.initialize(this, id); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, id) { + obj['id'] = id; + } + + /** + * Constructs a ListKeys200ResponseInner from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ListKeys200ResponseInner} obj Optional instance to populate. + * @return {module:model/ListKeys200ResponseInner} The populated ListKeys200ResponseInner instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ListKeys200ResponseInner(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} id + */ +ListKeys200ResponseInner.prototype['id'] = undefined; + +/** + * @member {String} name + */ +ListKeys200ResponseInner.prototype['name'] = undefined; + + + + + + +export default ListKeys200ResponseInner; + diff --git a/src/model/NodeClusterInfo.js b/src/model/NodeClusterInfo.js new file mode 100644 index 0000000..d1d9a26 --- /dev/null +++ b/src/model/NodeClusterInfo.js @@ -0,0 +1,94 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The NodeClusterInfo model module. + * @module model/NodeClusterInfo + * @version v0.8.0 + */ +class NodeClusterInfo { + /** + * Constructs a new NodeClusterInfo. + * @alias module:model/NodeClusterInfo + * @param zone {String} + * @param capacity {Number} + * @param tags {Array.} User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage + */ + constructor(zone, capacity, tags) { + + NodeClusterInfo.initialize(this, zone, capacity, tags); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, zone, capacity, tags) { + obj['zone'] = zone; + obj['capacity'] = capacity; + obj['tags'] = tags; + } + + /** + * Constructs a NodeClusterInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/NodeClusterInfo} obj Optional instance to populate. + * @return {module:model/NodeClusterInfo} The populated NodeClusterInfo instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new NodeClusterInfo(); + + if (data.hasOwnProperty('zone')) { + obj['zone'] = ApiClient.convertToType(data['zone'], 'String'); + } + if (data.hasOwnProperty('capacity')) { + obj['capacity'] = ApiClient.convertToType(data['capacity'], 'Number'); + } + if (data.hasOwnProperty('tags')) { + obj['tags'] = ApiClient.convertToType(data['tags'], ['String']); + } + } + return obj; + } + + +} + +/** + * @member {String} zone + */ +NodeClusterInfo.prototype['zone'] = undefined; + +/** + * @member {Number} capacity + */ +NodeClusterInfo.prototype['capacity'] = undefined; + +/** + * User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage + * @member {Array.} tags + */ +NodeClusterInfo.prototype['tags'] = undefined; + + + + + + +export default NodeClusterInfo; + diff --git a/src/model/NodeNetworkInfo.js b/src/model/NodeNetworkInfo.js new file mode 100644 index 0000000..e3ef062 --- /dev/null +++ b/src/model/NodeNetworkInfo.js @@ -0,0 +1,103 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The NodeNetworkInfo model module. + * @module model/NodeNetworkInfo + * @version v0.8.0 + */ +class NodeNetworkInfo { + /** + * Constructs a new NodeNetworkInfo. + * @alias module:model/NodeNetworkInfo + * @param addr {String} + * @param isUp {Boolean} + * @param lastSeenSecsAgo {Number} + * @param hostname {String} + */ + constructor(addr, isUp, lastSeenSecsAgo, hostname) { + + NodeNetworkInfo.initialize(this, addr, isUp, lastSeenSecsAgo, hostname); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, addr, isUp, lastSeenSecsAgo, hostname) { + obj['addr'] = addr; + obj['is_up'] = isUp; + obj['last_seen_secs_ago'] = lastSeenSecsAgo; + obj['hostname'] = hostname; + } + + /** + * Constructs a NodeNetworkInfo from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/NodeNetworkInfo} obj Optional instance to populate. + * @return {module:model/NodeNetworkInfo} The populated NodeNetworkInfo instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new NodeNetworkInfo(); + + if (data.hasOwnProperty('addr')) { + obj['addr'] = ApiClient.convertToType(data['addr'], 'String'); + } + if (data.hasOwnProperty('is_up')) { + obj['is_up'] = ApiClient.convertToType(data['is_up'], 'Boolean'); + } + if (data.hasOwnProperty('last_seen_secs_ago')) { + obj['last_seen_secs_ago'] = ApiClient.convertToType(data['last_seen_secs_ago'], 'Number'); + } + if (data.hasOwnProperty('hostname')) { + obj['hostname'] = ApiClient.convertToType(data['hostname'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {String} addr + */ +NodeNetworkInfo.prototype['addr'] = undefined; + +/** + * @member {Boolean} is_up + */ +NodeNetworkInfo.prototype['is_up'] = undefined; + +/** + * @member {Number} last_seen_secs_ago + */ +NodeNetworkInfo.prototype['last_seen_secs_ago'] = undefined; + +/** + * @member {String} hostname + */ +NodeNetworkInfo.prototype['hostname'] = undefined; + + + + + + +export default NodeNetworkInfo; + diff --git a/src/model/UpdateBucketRequest.js b/src/model/UpdateBucketRequest.js new file mode 100644 index 0000000..4085301 --- /dev/null +++ b/src/model/UpdateBucketRequest.js @@ -0,0 +1,81 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 UpdateBucketRequestQuotas from './UpdateBucketRequestQuotas'; +import UpdateBucketRequestWebsiteAccess from './UpdateBucketRequestWebsiteAccess'; + +/** + * The UpdateBucketRequest model module. + * @module model/UpdateBucketRequest + * @version v0.8.0 + */ +class UpdateBucketRequest { + /** + * Constructs a new UpdateBucketRequest. + * @alias module:model/UpdateBucketRequest + */ + constructor() { + + UpdateBucketRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateBucketRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateBucketRequest} obj Optional instance to populate. + * @return {module:model/UpdateBucketRequest} The populated UpdateBucketRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateBucketRequest(); + + if (data.hasOwnProperty('websiteAccess')) { + obj['websiteAccess'] = UpdateBucketRequestWebsiteAccess.constructFromObject(data['websiteAccess']); + } + if (data.hasOwnProperty('quotas')) { + obj['quotas'] = UpdateBucketRequestQuotas.constructFromObject(data['quotas']); + } + } + return obj; + } + + +} + +/** + * @member {module:model/UpdateBucketRequestWebsiteAccess} websiteAccess + */ +UpdateBucketRequest.prototype['websiteAccess'] = undefined; + +/** + * @member {module:model/UpdateBucketRequestQuotas} quotas + */ +UpdateBucketRequest.prototype['quotas'] = undefined; + + + + + + +export default UpdateBucketRequest; + diff --git a/src/model/UpdateBucketRequestQuotas.js b/src/model/UpdateBucketRequestQuotas.js new file mode 100644 index 0000000..7ffc0d9 --- /dev/null +++ b/src/model/UpdateBucketRequestQuotas.js @@ -0,0 +1,79 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The UpdateBucketRequestQuotas model module. + * @module model/UpdateBucketRequestQuotas + * @version v0.8.0 + */ +class UpdateBucketRequestQuotas { + /** + * Constructs a new UpdateBucketRequestQuotas. + * @alias module:model/UpdateBucketRequestQuotas + */ + constructor() { + + UpdateBucketRequestQuotas.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateBucketRequestQuotas from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateBucketRequestQuotas} obj Optional instance to populate. + * @return {module:model/UpdateBucketRequestQuotas} The populated UpdateBucketRequestQuotas instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateBucketRequestQuotas(); + + if (data.hasOwnProperty('maxSize')) { + obj['maxSize'] = ApiClient.convertToType(data['maxSize'], 'Number'); + } + if (data.hasOwnProperty('maxObjects')) { + obj['maxObjects'] = ApiClient.convertToType(data['maxObjects'], 'Number'); + } + } + return obj; + } + + +} + +/** + * @member {Number} maxSize + */ +UpdateBucketRequestQuotas.prototype['maxSize'] = undefined; + +/** + * @member {Number} maxObjects + */ +UpdateBucketRequestQuotas.prototype['maxObjects'] = undefined; + + + + + + +export default UpdateBucketRequestQuotas; + diff --git a/src/model/UpdateBucketRequestWebsiteAccess.js b/src/model/UpdateBucketRequestWebsiteAccess.js new file mode 100644 index 0000000..8b088e0 --- /dev/null +++ b/src/model/UpdateBucketRequestWebsiteAccess.js @@ -0,0 +1,87 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The UpdateBucketRequestWebsiteAccess model module. + * @module model/UpdateBucketRequestWebsiteAccess + * @version v0.8.0 + */ +class UpdateBucketRequestWebsiteAccess { + /** + * Constructs a new UpdateBucketRequestWebsiteAccess. + * @alias module:model/UpdateBucketRequestWebsiteAccess + */ + constructor() { + + UpdateBucketRequestWebsiteAccess.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateBucketRequestWebsiteAccess from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateBucketRequestWebsiteAccess} obj Optional instance to populate. + * @return {module:model/UpdateBucketRequestWebsiteAccess} The populated UpdateBucketRequestWebsiteAccess instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateBucketRequestWebsiteAccess(); + + if (data.hasOwnProperty('enabled')) { + obj['enabled'] = ApiClient.convertToType(data['enabled'], 'Boolean'); + } + if (data.hasOwnProperty('indexDocument')) { + obj['indexDocument'] = ApiClient.convertToType(data['indexDocument'], 'String'); + } + if (data.hasOwnProperty('errorDocument')) { + obj['errorDocument'] = ApiClient.convertToType(data['errorDocument'], 'String'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} enabled + */ +UpdateBucketRequestWebsiteAccess.prototype['enabled'] = undefined; + +/** + * @member {String} indexDocument + */ +UpdateBucketRequestWebsiteAccess.prototype['indexDocument'] = undefined; + +/** + * @member {String} errorDocument + */ +UpdateBucketRequestWebsiteAccess.prototype['errorDocument'] = undefined; + + + + + + +export default UpdateBucketRequestWebsiteAccess; + diff --git a/src/model/UpdateKeyRequest.js b/src/model/UpdateKeyRequest.js new file mode 100644 index 0000000..c641e7f --- /dev/null +++ b/src/model/UpdateKeyRequest.js @@ -0,0 +1,89 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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 UpdateKeyRequestAllow from './UpdateKeyRequestAllow'; +import UpdateKeyRequestDeny from './UpdateKeyRequestDeny'; + +/** + * The UpdateKeyRequest model module. + * @module model/UpdateKeyRequest + * @version v0.8.0 + */ +class UpdateKeyRequest { + /** + * Constructs a new UpdateKeyRequest. + * @alias module:model/UpdateKeyRequest + */ + constructor() { + + UpdateKeyRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateKeyRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateKeyRequest} obj Optional instance to populate. + * @return {module:model/UpdateKeyRequest} The populated UpdateKeyRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateKeyRequest(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('allow')) { + obj['allow'] = UpdateKeyRequestAllow.constructFromObject(data['allow']); + } + if (data.hasOwnProperty('deny')) { + obj['deny'] = UpdateKeyRequestDeny.constructFromObject(data['deny']); + } + } + return obj; + } + + +} + +/** + * @member {String} name + */ +UpdateKeyRequest.prototype['name'] = undefined; + +/** + * @member {module:model/UpdateKeyRequestAllow} allow + */ +UpdateKeyRequest.prototype['allow'] = undefined; + +/** + * @member {module:model/UpdateKeyRequestDeny} deny + */ +UpdateKeyRequest.prototype['deny'] = undefined; + + + + + + +export default UpdateKeyRequest; + diff --git a/src/model/UpdateKeyRequestAllow.js b/src/model/UpdateKeyRequestAllow.js new file mode 100644 index 0000000..18a7d70 --- /dev/null +++ b/src/model/UpdateKeyRequestAllow.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The UpdateKeyRequestAllow model module. + * @module model/UpdateKeyRequestAllow + * @version v0.8.0 + */ +class UpdateKeyRequestAllow { + /** + * Constructs a new UpdateKeyRequestAllow. + * @alias module:model/UpdateKeyRequestAllow + */ + constructor() { + + UpdateKeyRequestAllow.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateKeyRequestAllow from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateKeyRequestAllow} obj Optional instance to populate. + * @return {module:model/UpdateKeyRequestAllow} The populated UpdateKeyRequestAllow instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateKeyRequestAllow(); + + if (data.hasOwnProperty('createBucket')) { + obj['createBucket'] = ApiClient.convertToType(data['createBucket'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} createBucket + */ +UpdateKeyRequestAllow.prototype['createBucket'] = undefined; + + + + + + +export default UpdateKeyRequestAllow; + diff --git a/src/model/UpdateKeyRequestDeny.js b/src/model/UpdateKeyRequestDeny.js new file mode 100644 index 0000000..cb0286d --- /dev/null +++ b/src/model/UpdateKeyRequestDeny.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * 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'; + +/** + * The UpdateKeyRequestDeny model module. + * @module model/UpdateKeyRequestDeny + * @version v0.8.0 + */ +class UpdateKeyRequestDeny { + /** + * Constructs a new UpdateKeyRequestDeny. + * @alias module:model/UpdateKeyRequestDeny + */ + constructor() { + + UpdateKeyRequestDeny.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a UpdateKeyRequestDeny from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/UpdateKeyRequestDeny} obj Optional instance to populate. + * @return {module:model/UpdateKeyRequestDeny} The populated UpdateKeyRequestDeny instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new UpdateKeyRequestDeny(); + + if (data.hasOwnProperty('createBucket')) { + obj['createBucket'] = ApiClient.convertToType(data['createBucket'], 'Boolean'); + } + } + return obj; + } + + +} + +/** + * @member {Boolean} createBucket + */ +UpdateKeyRequestDeny.prototype['createBucket'] = undefined; + + + + + + +export default UpdateKeyRequestDeny; + diff --git a/test/api/BucketApi.spec.js b/test/api/BucketApi.spec.js new file mode 100644 index 0000000..7738713 --- /dev/null +++ b/test/api/BucketApi.spec.js @@ -0,0 +1,173 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.BucketApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BucketApi', function() { + describe('allowBucketKey', function() { + it('should call allowBucketKey successfully', function(done) { + //uncomment below and update the code to test allowBucketKey + //instance.allowBucketKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('createBucket', function() { + it('should call createBucket successfully', function(done) { + //uncomment below and update the code to test createBucket + //instance.createBucket(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteBucket', function() { + it('should call deleteBucket successfully', function(done) { + //uncomment below and update the code to test deleteBucket + //instance.deleteBucket(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteBucketGlobalAlias', function() { + it('should call deleteBucketGlobalAlias successfully', function(done) { + //uncomment below and update the code to test deleteBucketGlobalAlias + //instance.deleteBucketGlobalAlias(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteBucketLocalAlias', function() { + it('should call deleteBucketLocalAlias successfully', function(done) { + //uncomment below and update the code to test deleteBucketLocalAlias + //instance.deleteBucketLocalAlias(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('denyBucketKey', function() { + it('should call denyBucketKey successfully', function(done) { + //uncomment below and update the code to test denyBucketKey + //instance.denyBucketKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('findBucketInfo', function() { + it('should call findBucketInfo successfully', function(done) { + //uncomment below and update the code to test findBucketInfo + //instance.findBucketInfo(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getBucketInfo', function() { + it('should call getBucketInfo successfully', function(done) { + //uncomment below and update the code to test getBucketInfo + //instance.getBucketInfo(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('listBuckets', function() { + it('should call listBuckets successfully', function(done) { + //uncomment below and update the code to test listBuckets + //instance.listBuckets(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('putBucketGlobalAlias', function() { + it('should call putBucketGlobalAlias successfully', function(done) { + //uncomment below and update the code to test putBucketGlobalAlias + //instance.putBucketGlobalAlias(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('putBucketLocalAlias', function() { + it('should call putBucketLocalAlias successfully', function(done) { + //uncomment below and update the code to test putBucketLocalAlias + //instance.putBucketLocalAlias(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updateBucket', function() { + it('should call updateBucket successfully', function(done) { + //uncomment below and update the code to test updateBucket + //instance.updateBucket(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/api/KeyApi.spec.js b/test/api/KeyApi.spec.js new file mode 100644 index 0000000..9d79cce --- /dev/null +++ b/test/api/KeyApi.spec.js @@ -0,0 +1,123 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.KeyApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('KeyApi', function() { + describe('addKey', function() { + it('should call addKey successfully', function(done) { + //uncomment below and update the code to test addKey + //instance.addKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('deleteKey', function() { + it('should call deleteKey successfully', function(done) { + //uncomment below and update the code to test deleteKey + //instance.deleteKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getKey', function() { + it('should call getKey successfully', function(done) { + //uncomment below and update the code to test getKey + //instance.getKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('importKey', function() { + it('should call importKey successfully', function(done) { + //uncomment below and update the code to test importKey + //instance.importKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('listKeys', function() { + it('should call listKeys successfully', function(done) { + //uncomment below and update the code to test listKeys + //instance.listKeys(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('searchKey', function() { + it('should call searchKey successfully', function(done) { + //uncomment below and update the code to test searchKey + //instance.searchKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('updateKey', function() { + it('should call updateKey successfully', function(done) { + //uncomment below and update the code to test updateKey + //instance.updateKey(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/api/LayoutApi.spec.js b/test/api/LayoutApi.spec.js new file mode 100644 index 0000000..af8b434 --- /dev/null +++ b/test/api/LayoutApi.spec.js @@ -0,0 +1,93 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.LayoutApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('LayoutApi', function() { + describe('addLayout', function() { + it('should call addLayout successfully', function(done) { + //uncomment below and update the code to test addLayout + //instance.addLayout(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('applyLayout', function() { + it('should call applyLayout successfully', function(done) { + //uncomment below and update the code to test applyLayout + //instance.applyLayout(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getLayout', function() { + it('should call getLayout successfully', function(done) { + //uncomment below and update the code to test getLayout + //instance.getLayout(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('revertLayout', function() { + it('should call revertLayout successfully', function(done) { + //uncomment below and update the code to test revertLayout + //instance.revertLayout(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/api/NodesApi.spec.js b/test/api/NodesApi.spec.js new file mode 100644 index 0000000..d8282f5 --- /dev/null +++ b/test/api/NodesApi.spec.js @@ -0,0 +1,73 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.NodesApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('NodesApi', function() { + describe('addNode', function() { + it('should call addNode successfully', function(done) { + //uncomment below and update the code to test addNode + //instance.addNode(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('getNodes', function() { + it('should call getNodes successfully', function(done) { + //uncomment below and update the code to test getNodes + //instance.getNodes(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/model/AddKeyRequest.spec.js b/test/model/AddKeyRequest.spec.js new file mode 100644 index 0000000..aac4672 --- /dev/null +++ b/test/model/AddKeyRequest.spec.js @@ -0,0 +1,65 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.AddKeyRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AddKeyRequest', function() { + it('should create an instance of AddKeyRequest', function() { + // uncomment below and update the code to test AddKeyRequest + //var instance = new garage.AddKeyRequest(); + //expect(instance).to.be.a(garage.AddKeyRequest); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new garage.AddKeyRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/AddNode200ResponseInner.spec.js b/test/model/AddNode200ResponseInner.spec.js new file mode 100644 index 0000000..9677299 --- /dev/null +++ b/test/model/AddNode200ResponseInner.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.AddNode200ResponseInner(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AddNode200ResponseInner', function() { + it('should create an instance of AddNode200ResponseInner', function() { + // uncomment below and update the code to test AddNode200ResponseInner + //var instance = new garage.AddNode200ResponseInner(); + //expect(instance).to.be.a(garage.AddNode200ResponseInner); + }); + + it('should have the property success (base name: "success")', function() { + // uncomment below and update the code to test the property success + //var instance = new garage.AddNode200ResponseInner(); + //expect(instance).to.be(); + }); + + it('should have the property error (base name: "error")', function() { + // uncomment below and update the code to test the property error + //var instance = new garage.AddNode200ResponseInner(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/AllowBucketKeyRequest.spec.js b/test/model/AllowBucketKeyRequest.spec.js new file mode 100644 index 0000000..0291daf --- /dev/null +++ b/test/model/AllowBucketKeyRequest.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.AllowBucketKeyRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AllowBucketKeyRequest', function() { + it('should create an instance of AllowBucketKeyRequest', function() { + // uncomment below and update the code to test AllowBucketKeyRequest + //var instance = new garage.AllowBucketKeyRequest(); + //expect(instance).to.be.a(garage.AllowBucketKeyRequest); + }); + + it('should have the property bucketId (base name: "bucketId")', function() { + // uncomment below and update the code to test the property bucketId + //var instance = new garage.AllowBucketKeyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property accessKeyId (base name: "accessKeyId")', function() { + // uncomment below and update the code to test the property accessKeyId + //var instance = new garage.AllowBucketKeyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property permissions (base name: "permissions")', function() { + // uncomment below and update the code to test the property permissions + //var instance = new garage.AllowBucketKeyRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/AllowBucketKeyRequestPermissions.spec.js b/test/model/AllowBucketKeyRequestPermissions.spec.js new file mode 100644 index 0000000..3142e40 --- /dev/null +++ b/test/model/AllowBucketKeyRequestPermissions.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.AllowBucketKeyRequestPermissions(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('AllowBucketKeyRequestPermissions', function() { + it('should create an instance of AllowBucketKeyRequestPermissions', function() { + // uncomment below and update the code to test AllowBucketKeyRequestPermissions + //var instance = new garage.AllowBucketKeyRequestPermissions(); + //expect(instance).to.be.a(garage.AllowBucketKeyRequestPermissions); + }); + + it('should have the property read (base name: "read")', function() { + // uncomment below and update the code to test the property read + //var instance = new garage.AllowBucketKeyRequestPermissions(); + //expect(instance).to.be(); + }); + + it('should have the property write (base name: "write")', function() { + // uncomment below and update the code to test the property write + //var instance = new garage.AllowBucketKeyRequestPermissions(); + //expect(instance).to.be(); + }); + + it('should have the property owner (base name: "owner")', function() { + // uncomment below and update the code to test the property owner + //var instance = new garage.AllowBucketKeyRequestPermissions(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/BucketInfo.spec.js b/test/model/BucketInfo.spec.js new file mode 100644 index 0000000..72c7924 --- /dev/null +++ b/test/model/BucketInfo.spec.js @@ -0,0 +1,113 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.BucketInfo(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BucketInfo', function() { + it('should create an instance of BucketInfo', function() { + // uncomment below and update the code to test BucketInfo + //var instance = new garage.BucketInfo(); + //expect(instance).to.be.a(garage.BucketInfo); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property globalAliases (base name: "globalAliases")', function() { + // uncomment below and update the code to test the property globalAliases + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property websiteAccess (base name: "websiteAccess")', function() { + // uncomment below and update the code to test the property websiteAccess + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property websiteConfig (base name: "websiteConfig")', function() { + // uncomment below and update the code to test the property websiteConfig + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property keys (base name: "keys")', function() { + // uncomment below and update the code to test the property keys + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property objects (base name: "objects")', function() { + // uncomment below and update the code to test the property objects + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property bytes (base name: "bytes")', function() { + // uncomment below and update the code to test the property bytes + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property unfinishedUploads (base name: "unfinishedUploads")', function() { + // uncomment below and update the code to test the property unfinishedUploads + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + it('should have the property quotas (base name: "quotas")', function() { + // uncomment below and update the code to test the property quotas + //var instance = new garage.BucketInfo(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/BucketInfoQuotas.spec.js b/test/model/BucketInfoQuotas.spec.js new file mode 100644 index 0000000..2c63701 --- /dev/null +++ b/test/model/BucketInfoQuotas.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.BucketInfoQuotas(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BucketInfoQuotas', function() { + it('should create an instance of BucketInfoQuotas', function() { + // uncomment below and update the code to test BucketInfoQuotas + //var instance = new garage.BucketInfoQuotas(); + //expect(instance).to.be.a(garage.BucketInfoQuotas); + }); + + it('should have the property maxSize (base name: "maxSize")', function() { + // uncomment below and update the code to test the property maxSize + //var instance = new garage.BucketInfoQuotas(); + //expect(instance).to.be(); + }); + + it('should have the property maxObjects (base name: "maxObjects")', function() { + // uncomment below and update the code to test the property maxObjects + //var instance = new garage.BucketInfoQuotas(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/BucketInfoWebsiteConfig.spec.js b/test/model/BucketInfoWebsiteConfig.spec.js new file mode 100644 index 0000000..5f4698e --- /dev/null +++ b/test/model/BucketInfoWebsiteConfig.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.BucketInfoWebsiteConfig(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BucketInfoWebsiteConfig', function() { + it('should create an instance of BucketInfoWebsiteConfig', function() { + // uncomment below and update the code to test BucketInfoWebsiteConfig + //var instance = new garage.BucketInfoWebsiteConfig(); + //expect(instance).to.be.a(garage.BucketInfoWebsiteConfig); + }); + + it('should have the property indexDocument (base name: "indexDocument")', function() { + // uncomment below and update the code to test the property indexDocument + //var instance = new garage.BucketInfoWebsiteConfig(); + //expect(instance).to.be(); + }); + + it('should have the property errorDocument (base name: "errorDocument")', function() { + // uncomment below and update the code to test the property errorDocument + //var instance = new garage.BucketInfoWebsiteConfig(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/BucketKeyInfo.spec.js b/test/model/BucketKeyInfo.spec.js new file mode 100644 index 0000000..435be55 --- /dev/null +++ b/test/model/BucketKeyInfo.spec.js @@ -0,0 +1,83 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.BucketKeyInfo(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('BucketKeyInfo', function() { + it('should create an instance of BucketKeyInfo', function() { + // uncomment below and update the code to test BucketKeyInfo + //var instance = new garage.BucketKeyInfo(); + //expect(instance).to.be.a(garage.BucketKeyInfo); + }); + + it('should have the property accessKeyId (base name: "accessKeyId")', function() { + // uncomment below and update the code to test the property accessKeyId + //var instance = new garage.BucketKeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new garage.BucketKeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property permissions (base name: "permissions")', function() { + // uncomment below and update the code to test the property permissions + //var instance = new garage.BucketKeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property bucketLocalAliases (base name: "bucketLocalAliases")', function() { + // uncomment below and update the code to test the property bucketLocalAliases + //var instance = new garage.BucketKeyInfo(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/ClusterLayout.spec.js b/test/model/ClusterLayout.spec.js new file mode 100644 index 0000000..42bc3e1 --- /dev/null +++ b/test/model/ClusterLayout.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.ClusterLayout(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ClusterLayout', function() { + it('should create an instance of ClusterLayout', function() { + // uncomment below and update the code to test ClusterLayout + //var instance = new garage.ClusterLayout(); + //expect(instance).to.be.a(garage.ClusterLayout); + }); + + it('should have the property version (base name: "version")', function() { + // uncomment below and update the code to test the property version + //var instance = new garage.ClusterLayout(); + //expect(instance).to.be(); + }); + + it('should have the property roles (base name: "roles")', function() { + // uncomment below and update the code to test the property roles + //var instance = new garage.ClusterLayout(); + //expect(instance).to.be(); + }); + + it('should have the property stagedRoleChanges (base name: "stagedRoleChanges")', function() { + // uncomment below and update the code to test the property stagedRoleChanges + //var instance = new garage.ClusterLayout(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/CreateBucketRequest.spec.js b/test/model/CreateBucketRequest.spec.js new file mode 100644 index 0000000..7758956 --- /dev/null +++ b/test/model/CreateBucketRequest.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.CreateBucketRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('CreateBucketRequest', function() { + it('should create an instance of CreateBucketRequest', function() { + // uncomment below and update the code to test CreateBucketRequest + //var instance = new garage.CreateBucketRequest(); + //expect(instance).to.be.a(garage.CreateBucketRequest); + }); + + it('should have the property globalAlias (base name: "globalAlias")', function() { + // uncomment below and update the code to test the property globalAlias + //var instance = new garage.CreateBucketRequest(); + //expect(instance).to.be(); + }); + + it('should have the property localAlias (base name: "localAlias")', function() { + // uncomment below and update the code to test the property localAlias + //var instance = new garage.CreateBucketRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/CreateBucketRequestLocalAlias.spec.js b/test/model/CreateBucketRequestLocalAlias.spec.js new file mode 100644 index 0000000..434d52b --- /dev/null +++ b/test/model/CreateBucketRequestLocalAlias.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.CreateBucketRequestLocalAlias(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('CreateBucketRequestLocalAlias', function() { + it('should create an instance of CreateBucketRequestLocalAlias', function() { + // uncomment below and update the code to test CreateBucketRequestLocalAlias + //var instance = new garage.CreateBucketRequestLocalAlias(); + //expect(instance).to.be.a(garage.CreateBucketRequestLocalAlias); + }); + + it('should have the property accessKeyId (base name: "accessKeyId")', function() { + // uncomment below and update the code to test the property accessKeyId + //var instance = new garage.CreateBucketRequestLocalAlias(); + //expect(instance).to.be(); + }); + + it('should have the property alias (base name: "alias")', function() { + // uncomment below and update the code to test the property alias + //var instance = new garage.CreateBucketRequestLocalAlias(); + //expect(instance).to.be(); + }); + + it('should have the property allow (base name: "allow")', function() { + // uncomment below and update the code to test the property allow + //var instance = new garage.CreateBucketRequestLocalAlias(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/CreateBucketRequestLocalAliasAllow.spec.js b/test/model/CreateBucketRequestLocalAliasAllow.spec.js new file mode 100644 index 0000000..5d1a32d --- /dev/null +++ b/test/model/CreateBucketRequestLocalAliasAllow.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.CreateBucketRequestLocalAliasAllow(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('CreateBucketRequestLocalAliasAllow', function() { + it('should create an instance of CreateBucketRequestLocalAliasAllow', function() { + // uncomment below and update the code to test CreateBucketRequestLocalAliasAllow + //var instance = new garage.CreateBucketRequestLocalAliasAllow(); + //expect(instance).to.be.a(garage.CreateBucketRequestLocalAliasAllow); + }); + + it('should have the property read (base name: "read")', function() { + // uncomment below and update the code to test the property read + //var instance = new garage.CreateBucketRequestLocalAliasAllow(); + //expect(instance).to.be(); + }); + + it('should have the property write (base name: "write")', function() { + // uncomment below and update the code to test the property write + //var instance = new garage.CreateBucketRequestLocalAliasAllow(); + //expect(instance).to.be(); + }); + + it('should have the property owner (base name: "owner")', function() { + // uncomment below and update the code to test the property owner + //var instance = new garage.CreateBucketRequestLocalAliasAllow(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/GetNodes200Response.spec.js b/test/model/GetNodes200Response.spec.js new file mode 100644 index 0000000..3f9216a --- /dev/null +++ b/test/model/GetNodes200Response.spec.js @@ -0,0 +1,83 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.GetNodes200Response(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('GetNodes200Response', function() { + it('should create an instance of GetNodes200Response', function() { + // uncomment below and update the code to test GetNodes200Response + //var instance = new garage.GetNodes200Response(); + //expect(instance).to.be.a(garage.GetNodes200Response); + }); + + it('should have the property node (base name: "node")', function() { + // uncomment below and update the code to test the property node + //var instance = new garage.GetNodes200Response(); + //expect(instance).to.be(); + }); + + it('should have the property garageVersion (base name: "garageVersion")', function() { + // uncomment below and update the code to test the property garageVersion + //var instance = new garage.GetNodes200Response(); + //expect(instance).to.be(); + }); + + it('should have the property knownNodes (base name: "knownNodes")', function() { + // uncomment below and update the code to test the property knownNodes + //var instance = new garage.GetNodes200Response(); + //expect(instance).to.be(); + }); + + it('should have the property layout (base name: "layout")', function() { + // uncomment below and update the code to test the property layout + //var instance = new garage.GetNodes200Response(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/ImportKeyRequest.spec.js b/test/model/ImportKeyRequest.spec.js new file mode 100644 index 0000000..68c66b0 --- /dev/null +++ b/test/model/ImportKeyRequest.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.ImportKeyRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ImportKeyRequest', function() { + it('should create an instance of ImportKeyRequest', function() { + // uncomment below and update the code to test ImportKeyRequest + //var instance = new garage.ImportKeyRequest(); + //expect(instance).to.be.a(garage.ImportKeyRequest); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new garage.ImportKeyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property accessKeyId (base name: "accessKeyId")', function() { + // uncomment below and update the code to test the property accessKeyId + //var instance = new garage.ImportKeyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property secretAccessKey (base name: "secretAccessKey")', function() { + // uncomment below and update the code to test the property secretAccessKey + //var instance = new garage.ImportKeyRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/KeyInfo.spec.js b/test/model/KeyInfo.spec.js new file mode 100644 index 0000000..17a19f6 --- /dev/null +++ b/test/model/KeyInfo.spec.js @@ -0,0 +1,89 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.KeyInfo(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('KeyInfo', function() { + it('should create an instance of KeyInfo', function() { + // uncomment below and update the code to test KeyInfo + //var instance = new garage.KeyInfo(); + //expect(instance).to.be.a(garage.KeyInfo); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new garage.KeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property accessKeyId (base name: "accessKeyId")', function() { + // uncomment below and update the code to test the property accessKeyId + //var instance = new garage.KeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property secretAccessKey (base name: "secretAccessKey")', function() { + // uncomment below and update the code to test the property secretAccessKey + //var instance = new garage.KeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property permissions (base name: "permissions")', function() { + // uncomment below and update the code to test the property permissions + //var instance = new garage.KeyInfo(); + //expect(instance).to.be(); + }); + + it('should have the property buckets (base name: "buckets")', function() { + // uncomment below and update the code to test the property buckets + //var instance = new garage.KeyInfo(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/KeyInfoBucketsInner.spec.js b/test/model/KeyInfoBucketsInner.spec.js new file mode 100644 index 0000000..c22c06f --- /dev/null +++ b/test/model/KeyInfoBucketsInner.spec.js @@ -0,0 +1,83 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.KeyInfoBucketsInner(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('KeyInfoBucketsInner', function() { + it('should create an instance of KeyInfoBucketsInner', function() { + // uncomment below and update the code to test KeyInfoBucketsInner + //var instance = new garage.KeyInfoBucketsInner(); + //expect(instance).to.be.a(garage.KeyInfoBucketsInner); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instance = new garage.KeyInfoBucketsInner(); + //expect(instance).to.be(); + }); + + it('should have the property globalAliases (base name: "globalAliases")', function() { + // uncomment below and update the code to test the property globalAliases + //var instance = new garage.KeyInfoBucketsInner(); + //expect(instance).to.be(); + }); + + it('should have the property localAliases (base name: "localAliases")', function() { + // uncomment below and update the code to test the property localAliases + //var instance = new garage.KeyInfoBucketsInner(); + //expect(instance).to.be(); + }); + + it('should have the property permissions (base name: "permissions")', function() { + // uncomment below and update the code to test the property permissions + //var instance = new garage.KeyInfoBucketsInner(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/KeyInfoBucketsInnerPermissions.spec.js b/test/model/KeyInfoBucketsInnerPermissions.spec.js new file mode 100644 index 0000000..4c1a4e3 --- /dev/null +++ b/test/model/KeyInfoBucketsInnerPermissions.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.KeyInfoBucketsInnerPermissions(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('KeyInfoBucketsInnerPermissions', function() { + it('should create an instance of KeyInfoBucketsInnerPermissions', function() { + // uncomment below and update the code to test KeyInfoBucketsInnerPermissions + //var instance = new garage.KeyInfoBucketsInnerPermissions(); + //expect(instance).to.be.a(garage.KeyInfoBucketsInnerPermissions); + }); + + it('should have the property read (base name: "read")', function() { + // uncomment below and update the code to test the property read + //var instance = new garage.KeyInfoBucketsInnerPermissions(); + //expect(instance).to.be(); + }); + + it('should have the property write (base name: "write")', function() { + // uncomment below and update the code to test the property write + //var instance = new garage.KeyInfoBucketsInnerPermissions(); + //expect(instance).to.be(); + }); + + it('should have the property owner (base name: "owner")', function() { + // uncomment below and update the code to test the property owner + //var instance = new garage.KeyInfoBucketsInnerPermissions(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/KeyInfoPermissions.spec.js b/test/model/KeyInfoPermissions.spec.js new file mode 100644 index 0000000..6952885 --- /dev/null +++ b/test/model/KeyInfoPermissions.spec.js @@ -0,0 +1,65 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.KeyInfoPermissions(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('KeyInfoPermissions', function() { + it('should create an instance of KeyInfoPermissions', function() { + // uncomment below and update the code to test KeyInfoPermissions + //var instance = new garage.KeyInfoPermissions(); + //expect(instance).to.be.a(garage.KeyInfoPermissions); + }); + + it('should have the property createBucket (base name: "createBucket")', function() { + // uncomment below and update the code to test the property createBucket + //var instance = new garage.KeyInfoPermissions(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/LayoutVersion.spec.js b/test/model/LayoutVersion.spec.js new file mode 100644 index 0000000..86d1aab --- /dev/null +++ b/test/model/LayoutVersion.spec.js @@ -0,0 +1,65 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.LayoutVersion(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('LayoutVersion', function() { + it('should create an instance of LayoutVersion', function() { + // uncomment below and update the code to test LayoutVersion + //var instance = new garage.LayoutVersion(); + //expect(instance).to.be.a(garage.LayoutVersion); + }); + + it('should have the property version (base name: "version")', function() { + // uncomment below and update the code to test the property version + //var instance = new garage.LayoutVersion(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/ListBuckets200ResponseInner.spec.js b/test/model/ListBuckets200ResponseInner.spec.js new file mode 100644 index 0000000..bf97b77 --- /dev/null +++ b/test/model/ListBuckets200ResponseInner.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.ListBuckets200ResponseInner(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ListBuckets200ResponseInner', function() { + it('should create an instance of ListBuckets200ResponseInner', function() { + // uncomment below and update the code to test ListBuckets200ResponseInner + //var instance = new garage.ListBuckets200ResponseInner(); + //expect(instance).to.be.a(garage.ListBuckets200ResponseInner); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instance = new garage.ListBuckets200ResponseInner(); + //expect(instance).to.be(); + }); + + it('should have the property globalAliases (base name: "globalAliases")', function() { + // uncomment below and update the code to test the property globalAliases + //var instance = new garage.ListBuckets200ResponseInner(); + //expect(instance).to.be(); + }); + + it('should have the property localAliases (base name: "localAliases")', function() { + // uncomment below and update the code to test the property localAliases + //var instance = new garage.ListBuckets200ResponseInner(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/ListBuckets200ResponseInnerLocalAliasesInner.spec.js b/test/model/ListBuckets200ResponseInnerLocalAliasesInner.spec.js new file mode 100644 index 0000000..e3fd5fc --- /dev/null +++ b/test/model/ListBuckets200ResponseInnerLocalAliasesInner.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.ListBuckets200ResponseInnerLocalAliasesInner(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ListBuckets200ResponseInnerLocalAliasesInner', function() { + it('should create an instance of ListBuckets200ResponseInnerLocalAliasesInner', function() { + // uncomment below and update the code to test ListBuckets200ResponseInnerLocalAliasesInner + //var instance = new garage.ListBuckets200ResponseInnerLocalAliasesInner(); + //expect(instance).to.be.a(garage.ListBuckets200ResponseInnerLocalAliasesInner); + }); + + it('should have the property alias (base name: "alias")', function() { + // uncomment below and update the code to test the property alias + //var instance = new garage.ListBuckets200ResponseInnerLocalAliasesInner(); + //expect(instance).to.be(); + }); + + it('should have the property accessKeyId (base name: "accessKeyId")', function() { + // uncomment below and update the code to test the property accessKeyId + //var instance = new garage.ListBuckets200ResponseInnerLocalAliasesInner(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/ListKeys200ResponseInner.spec.js b/test/model/ListKeys200ResponseInner.spec.js new file mode 100644 index 0000000..408237f --- /dev/null +++ b/test/model/ListKeys200ResponseInner.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.ListKeys200ResponseInner(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('ListKeys200ResponseInner', function() { + it('should create an instance of ListKeys200ResponseInner', function() { + // uncomment below and update the code to test ListKeys200ResponseInner + //var instance = new garage.ListKeys200ResponseInner(); + //expect(instance).to.be.a(garage.ListKeys200ResponseInner); + }); + + it('should have the property id (base name: "id")', function() { + // uncomment below and update the code to test the property id + //var instance = new garage.ListKeys200ResponseInner(); + //expect(instance).to.be(); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new garage.ListKeys200ResponseInner(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/NodeClusterInfo.spec.js b/test/model/NodeClusterInfo.spec.js new file mode 100644 index 0000000..7f2af56 --- /dev/null +++ b/test/model/NodeClusterInfo.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.NodeClusterInfo(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('NodeClusterInfo', function() { + it('should create an instance of NodeClusterInfo', function() { + // uncomment below and update the code to test NodeClusterInfo + //var instance = new garage.NodeClusterInfo(); + //expect(instance).to.be.a(garage.NodeClusterInfo); + }); + + it('should have the property zone (base name: "zone")', function() { + // uncomment below and update the code to test the property zone + //var instance = new garage.NodeClusterInfo(); + //expect(instance).to.be(); + }); + + it('should have the property capacity (base name: "capacity")', function() { + // uncomment below and update the code to test the property capacity + //var instance = new garage.NodeClusterInfo(); + //expect(instance).to.be(); + }); + + it('should have the property tags (base name: "tags")', function() { + // uncomment below and update the code to test the property tags + //var instance = new garage.NodeClusterInfo(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/NodeNetworkInfo.spec.js b/test/model/NodeNetworkInfo.spec.js new file mode 100644 index 0000000..fb77eaf --- /dev/null +++ b/test/model/NodeNetworkInfo.spec.js @@ -0,0 +1,83 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.NodeNetworkInfo(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('NodeNetworkInfo', function() { + it('should create an instance of NodeNetworkInfo', function() { + // uncomment below and update the code to test NodeNetworkInfo + //var instance = new garage.NodeNetworkInfo(); + //expect(instance).to.be.a(garage.NodeNetworkInfo); + }); + + it('should have the property addr (base name: "addr")', function() { + // uncomment below and update the code to test the property addr + //var instance = new garage.NodeNetworkInfo(); + //expect(instance).to.be(); + }); + + it('should have the property isUp (base name: "is_up")', function() { + // uncomment below and update the code to test the property isUp + //var instance = new garage.NodeNetworkInfo(); + //expect(instance).to.be(); + }); + + it('should have the property lastSeenSecsAgo (base name: "last_seen_secs_ago")', function() { + // uncomment below and update the code to test the property lastSeenSecsAgo + //var instance = new garage.NodeNetworkInfo(); + //expect(instance).to.be(); + }); + + it('should have the property hostname (base name: "hostname")', function() { + // uncomment below and update the code to test the property hostname + //var instance = new garage.NodeNetworkInfo(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/UpdateBucketRequest.spec.js b/test/model/UpdateBucketRequest.spec.js new file mode 100644 index 0000000..a6993c4 --- /dev/null +++ b/test/model/UpdateBucketRequest.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.UpdateBucketRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UpdateBucketRequest', function() { + it('should create an instance of UpdateBucketRequest', function() { + // uncomment below and update the code to test UpdateBucketRequest + //var instance = new garage.UpdateBucketRequest(); + //expect(instance).to.be.a(garage.UpdateBucketRequest); + }); + + it('should have the property websiteAccess (base name: "websiteAccess")', function() { + // uncomment below and update the code to test the property websiteAccess + //var instance = new garage.UpdateBucketRequest(); + //expect(instance).to.be(); + }); + + it('should have the property quotas (base name: "quotas")', function() { + // uncomment below and update the code to test the property quotas + //var instance = new garage.UpdateBucketRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/UpdateBucketRequestQuotas.spec.js b/test/model/UpdateBucketRequestQuotas.spec.js new file mode 100644 index 0000000..a07bd03 --- /dev/null +++ b/test/model/UpdateBucketRequestQuotas.spec.js @@ -0,0 +1,71 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.UpdateBucketRequestQuotas(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UpdateBucketRequestQuotas', function() { + it('should create an instance of UpdateBucketRequestQuotas', function() { + // uncomment below and update the code to test UpdateBucketRequestQuotas + //var instance = new garage.UpdateBucketRequestQuotas(); + //expect(instance).to.be.a(garage.UpdateBucketRequestQuotas); + }); + + it('should have the property maxSize (base name: "maxSize")', function() { + // uncomment below and update the code to test the property maxSize + //var instance = new garage.UpdateBucketRequestQuotas(); + //expect(instance).to.be(); + }); + + it('should have the property maxObjects (base name: "maxObjects")', function() { + // uncomment below and update the code to test the property maxObjects + //var instance = new garage.UpdateBucketRequestQuotas(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/UpdateBucketRequestWebsiteAccess.spec.js b/test/model/UpdateBucketRequestWebsiteAccess.spec.js new file mode 100644 index 0000000..8a4f464 --- /dev/null +++ b/test/model/UpdateBucketRequestWebsiteAccess.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.UpdateBucketRequestWebsiteAccess(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UpdateBucketRequestWebsiteAccess', function() { + it('should create an instance of UpdateBucketRequestWebsiteAccess', function() { + // uncomment below and update the code to test UpdateBucketRequestWebsiteAccess + //var instance = new garage.UpdateBucketRequestWebsiteAccess(); + //expect(instance).to.be.a(garage.UpdateBucketRequestWebsiteAccess); + }); + + it('should have the property enabled (base name: "enabled")', function() { + // uncomment below and update the code to test the property enabled + //var instance = new garage.UpdateBucketRequestWebsiteAccess(); + //expect(instance).to.be(); + }); + + it('should have the property indexDocument (base name: "indexDocument")', function() { + // uncomment below and update the code to test the property indexDocument + //var instance = new garage.UpdateBucketRequestWebsiteAccess(); + //expect(instance).to.be(); + }); + + it('should have the property errorDocument (base name: "errorDocument")', function() { + // uncomment below and update the code to test the property errorDocument + //var instance = new garage.UpdateBucketRequestWebsiteAccess(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/UpdateKeyRequest.spec.js b/test/model/UpdateKeyRequest.spec.js new file mode 100644 index 0000000..8407e88 --- /dev/null +++ b/test/model/UpdateKeyRequest.spec.js @@ -0,0 +1,77 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.UpdateKeyRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UpdateKeyRequest', function() { + it('should create an instance of UpdateKeyRequest', function() { + // uncomment below and update the code to test UpdateKeyRequest + //var instance = new garage.UpdateKeyRequest(); + //expect(instance).to.be.a(garage.UpdateKeyRequest); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new garage.UpdateKeyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property allow (base name: "allow")', function() { + // uncomment below and update the code to test the property allow + //var instance = new garage.UpdateKeyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property deny (base name: "deny")', function() { + // uncomment below and update the code to test the property deny + //var instance = new garage.UpdateKeyRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/UpdateKeyRequestAllow.spec.js b/test/model/UpdateKeyRequestAllow.spec.js new file mode 100644 index 0000000..cab9a15 --- /dev/null +++ b/test/model/UpdateKeyRequestAllow.spec.js @@ -0,0 +1,65 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.UpdateKeyRequestAllow(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UpdateKeyRequestAllow', function() { + it('should create an instance of UpdateKeyRequestAllow', function() { + // uncomment below and update the code to test UpdateKeyRequestAllow + //var instance = new garage.UpdateKeyRequestAllow(); + //expect(instance).to.be.a(garage.UpdateKeyRequestAllow); + }); + + it('should have the property createBucket (base name: "createBucket")', function() { + // uncomment below and update the code to test the property createBucket + //var instance = new garage.UpdateKeyRequestAllow(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/model/UpdateKeyRequestDeny.spec.js b/test/model/UpdateKeyRequestDeny.spec.js new file mode 100644 index 0000000..ce995fd --- /dev/null +++ b/test/model/UpdateKeyRequestDeny.spec.js @@ -0,0 +1,65 @@ +/** + * Garage Administration API v0+garage-v0.8.0 + * 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!* + * + * The version of the OpenAPI document: v0.8.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.garage); + } +}(this, function(expect, garage) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new garage.UpdateKeyRequestDeny(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('UpdateKeyRequestDeny', function() { + it('should create an instance of UpdateKeyRequestDeny', function() { + // uncomment below and update the code to test UpdateKeyRequestDeny + //var instance = new garage.UpdateKeyRequestDeny(); + //expect(instance).to.be.a(garage.UpdateKeyRequestDeny); + }); + + it('should have the property createBucket (base name: "createBucket")', function() { + // uncomment below and update the code to test the property createBucket + //var instance = new garage.UpdateKeyRequestDeny(); + //expect(instance).to.be(); + }); + + }); + +}));