api-v1, generator #2

Merged
quentin merged 15 commits from v0.9.x into main 2023-11-28 15:40:37 +00:00
5 changed files with 20 additions and 18 deletions
Showing only changes of commit 1428c6d627 - Show all commits

View file

@ -41,7 +41,7 @@ from garage_admin_sdk.apis import *
from garage_admin_sdk.models import * from garage_admin_sdk.models import *
configuration = garage_admin_sdk.Configuration( configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0", host = "http://localhost:3903/v1",
access_token = "s3cr3t" access_token = "s3cr3t"
) )
@ -108,9 +108,9 @@ npm install --save git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-js.
A short example: A short example:
```javascript ```javascript
const garage = require('garage_administration_api_v0garage_v0_8_0'); const garage = require('garage_administration_api_v1garage_v0_9_0');
const api = new garage.ApiClient("http://127.0.0.1:3903/v0"); const api = new garage.ApiClient("http://127.0.0.1:3903/v1");
api.authentications['bearerAuth'].accessToken = "s3cr3t"; api.authentications['bearerAuth'].accessToken = "s3cr3t";
const [node, layout, key, bucket] = [ const [node, layout, key, bucket] = [

View file

@ -16,7 +16,7 @@ task buildPythonClient(type: org.openapitools.generator.gradle.plugin.tasks.Gene
gitRepoId = "garage-admin-sdk-python" gitRepoId = "garage-admin-sdk-python"
configOptions = [ configOptions = [
packageName: "garage_admin_sdk", packageName: "garage_admin_sdk",
packageVersion: "0.8.0", packageVersion: "0.9.0",
projectName: "garage-admin-sdk-python" projectName: "garage-admin-sdk-python"
] ]
} }
@ -30,7 +30,7 @@ task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.Generate
gitRepoId = "garage-admin-sdk-golang" gitRepoId = "garage-admin-sdk-golang"
configOptions = [ configOptions = [
packageName: "garage", packageName: "garage",
packageVersion: "0.8.0" packageVersion: "0.9.0"
] ]
} }
@ -46,7 +46,7 @@ task buildJavascriptClient(type: org.openapitools.generator.gradle.plugin.tasks.
moduleName: "garage", moduleName: "garage",
npmName: "garage-admin-sdk-js", npmName: "garage-admin-sdk-js",
npmRepository: "@dxflrs/garage-admin-sdk-js", npmRepository: "@dxflrs/garage-admin-sdk-js",
packageVersion: "0.8.0", packageVersion: "0.9.0",
usePromises: "true", usePromises: "true",
] ]
} }

View file

@ -3,7 +3,7 @@ from garage_admin_sdk.apis import *
from garage_admin_sdk.models import * from garage_admin_sdk.models import *
configuration = garage_admin_sdk.Configuration( configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0", host = "http://localhost:3903/v1",
access_token = "s3cr3t" access_token = "s3cr3t"
) )
@ -25,13 +25,14 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
exit(1) exit(1)
print("it seems to be a fresh node, continuing the configuration") print("it seems to be a fresh node, continuing the configuration")
layout.add_layout({ layout.add_layout([
status.node: NodeClusterInfo( NodeRoleChange(
id = status.node,
zone = "dc1", zone = "dc1",
capacity = 1, capacity = 1000000000,
tags = [ "dev" ], tags = [ "dev" ],
) )
}) ])
print("added myself to the layout") print("added myself to the layout")
current = layout.get_layout() current = layout.get_layout()
@ -63,7 +64,7 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
print(f"key {kinfo.access_key_id} can now create buckets") print(f"key {kinfo.access_key_id} can now create buckets")
# update key info # update key info
kinfo = keys.search_key("openapi") kinfo = keys.search_key("openapi", show_secret_key=True)
print(f"key permissions: {kinfo.permissions}") print(f"key permissions: {kinfo.permissions}")
# ---- THE END --- # ---- THE END ---

View file

@ -1 +1 @@
git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-python@f48df53 git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-python@715450cfe6

View file

@ -3,7 +3,7 @@ from garage_admin_sdk.apis import *
from garage_admin_sdk.models import * from garage_admin_sdk.models import *
configuration = garage_admin_sdk.Configuration( configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v0", host = "http://localhost:3903/v1",
access_token = "s3cr3t" access_token = "s3cr3t"
) )
@ -17,13 +17,14 @@ print(f"running garage {status.garage_version}, node_id {status.node}")
# Change layout of this node # Change layout of this node
current = layout.get_layout() current = layout.get_layout()
layout.add_layout({ layout.add_layout([
status.node: NodeClusterInfo( NodeRoleChange(
id = status.node,
zone = "dc1", zone = "dc1",
capacity = 1, capacity = 1000000000,
tags = [ "dev" ], tags = [ "dev" ],
) )
}) ])
layout.apply_layout(LayoutVersion( layout.apply_layout(LayoutVersion(
version = current.version + 1 version = current.version + 1
)) ))