partially fix python examples
This commit is contained in:
parent
4073edbfcb
commit
1428c6d627
5 changed files with 20 additions and 18 deletions
|
@ -41,7 +41,7 @@ from garage_admin_sdk.apis import *
|
|||
from garage_admin_sdk.models import *
|
||||
|
||||
configuration = garage_admin_sdk.Configuration(
|
||||
host = "http://localhost:3903/v0",
|
||||
host = "http://localhost:3903/v1",
|
||||
access_token = "s3cr3t"
|
||||
)
|
||||
|
||||
|
@ -108,9 +108,9 @@ npm install --save git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-js.
|
|||
A short example:
|
||||
|
||||
```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";
|
||||
|
||||
const [node, layout, key, bucket] = [
|
||||
|
|
|
@ -16,7 +16,7 @@ task buildPythonClient(type: org.openapitools.generator.gradle.plugin.tasks.Gene
|
|||
gitRepoId = "garage-admin-sdk-python"
|
||||
configOptions = [
|
||||
packageName: "garage_admin_sdk",
|
||||
packageVersion: "0.8.0",
|
||||
packageVersion: "0.9.0",
|
||||
projectName: "garage-admin-sdk-python"
|
||||
]
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.Generate
|
|||
gitRepoId = "garage-admin-sdk-golang"
|
||||
configOptions = [
|
||||
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",
|
||||
npmName: "garage-admin-sdk-js",
|
||||
npmRepository: "@dxflrs/garage-admin-sdk-js",
|
||||
packageVersion: "0.8.0",
|
||||
packageVersion: "0.9.0",
|
||||
usePromises: "true",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ from garage_admin_sdk.apis import *
|
|||
from garage_admin_sdk.models import *
|
||||
|
||||
configuration = garage_admin_sdk.Configuration(
|
||||
host = "http://localhost:3903/v0",
|
||||
host = "http://localhost:3903/v1",
|
||||
access_token = "s3cr3t"
|
||||
)
|
||||
|
||||
|
@ -25,13 +25,14 @@ with garage_admin_sdk.ApiClient(configuration) as api_client:
|
|||
exit(1)
|
||||
print("it seems to be a fresh node, continuing the configuration")
|
||||
|
||||
layout.add_layout({
|
||||
status.node: NodeClusterInfo(
|
||||
layout.add_layout([
|
||||
NodeRoleChange(
|
||||
id = status.node,
|
||||
zone = "dc1",
|
||||
capacity = 1,
|
||||
capacity = 1000000000,
|
||||
tags = [ "dev" ],
|
||||
)
|
||||
})
|
||||
])
|
||||
print("added myself to the 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")
|
||||
|
||||
# update key info
|
||||
kinfo = keys.search_key("openapi")
|
||||
kinfo = keys.search_key("openapi", show_secret_key=True)
|
||||
print(f"key permissions: {kinfo.permissions}")
|
||||
|
||||
# ---- THE END ---
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,7 @@ from garage_admin_sdk.apis import *
|
|||
from garage_admin_sdk.models import *
|
||||
|
||||
configuration = garage_admin_sdk.Configuration(
|
||||
host = "http://localhost:3903/v0",
|
||||
host = "http://localhost:3903/v1",
|
||||
access_token = "s3cr3t"
|
||||
)
|
||||
|
||||
|
@ -17,13 +17,14 @@ print(f"running garage {status.garage_version}, node_id {status.node}")
|
|||
|
||||
# Change layout of this node
|
||||
current = layout.get_layout()
|
||||
layout.add_layout({
|
||||
status.node: NodeClusterInfo(
|
||||
layout.add_layout([
|
||||
NodeRoleChange(
|
||||
id = status.node,
|
||||
zone = "dc1",
|
||||
capacity = 1,
|
||||
capacity = 1000000000,
|
||||
tags = [ "dev" ],
|
||||
)
|
||||
})
|
||||
])
|
||||
layout.apply_layout(LayoutVersion(
|
||||
version = current.version + 1
|
||||
))
|
||||
|
|
Loading…
Reference in a new issue