Skip to content

Commit c5d0175

Browse files
Merge pull request #34 from indigo-dc/deep-devel
Added support for new parameters, fix #33
2 parents 789f461 + 8ab8f99 commit c5d0175

File tree

4 files changed

+35
-24
lines changed

4 files changed

+35
-24
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ For more information and more examples please see the [documentation](https://in
103103

104104
## using Docker
105105
If your system is not supported you can still use orchent through a lightweight Docker container.
106-
Download the container in the release section and import it using the `docker load` command:
106+
Download the container in the [release section](https://github.com/indigo-dc/orchent/releases)(choose the latest stable version) and import it using the `docker load` command, e.g.:
107107
```
108108
docker load --input orchent_container_1.1.0.tar
109109
```

gitbook/admin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ yum install golang
4848

4949
#### Importing the Docker Container
5050
If your system is not supported you can still use orchent through a lightweight Docker container.
51-
Download the container in the release section and import it using the `docker load` command:
51+
Download the container in the [release section](https://github.com/indigo-dc/orchent/releases) (choose the latest stable version) and import it using the `docker load` command, e.g.:
5252
```
5353
docker load --input orchent_container_1.0.4.tar
5454
```

gitbook/user.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,13 @@ usage: orchent depcreate [<flags>] <template> <parameter>
142142
create a new deployment
143143
144144
Flags:
145-
--help Show context-sensitive help (also try --help-long and --help-man).
146-
--version Show application version.
147-
-u, --url=URL the base url of the orchestrator rest interface. Alternative the environment
148-
variable 'ORCHENT_URL' can be used: 'export ORCHENT_URL=<the_url>'
149-
--callback="" the callback url
145+
--help Show context-sensitive help (also try --help-long and --help-man).
146+
--version Show application version.
147+
-u, --url=URL the base url of the orchestrator rest interface. Alternative the environment variable 'ORCHENT_URL' can be used: 'export ORCHENT_URL=<the_url>'
148+
--callback="" the callback url
149+
--maxProvidersRetry=MAXPROVIDERSRETRY
150+
Maximum number of cloud providers to be used in case of failure (Default: UNBOUNDED).
151+
--keepLastAttempt=true In case of failure, keep the resources allocated in the last try (Default: true).
150152
151153
Args:
152154
<template> the tosca template file

orchent.go

+26-17
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"strings"
1919
)
2020

21-
const OrchentVersion string = "1.2.0"
21+
const OrchentVersion string = "1.2.1"
2222

2323
var (
2424
app = kingpin.New("orchent", "The orchestrator client. \n \nPlease either store your access token in 'ORCHENT_TOKEN' or set the account to use with oidc-agent in the 'ORCHENT_AGENT_ACCOUNT' and the socket of the oidc-agent in the 'OIDC_SOCK' environment variable: \n export ORCHENT_TOKEN=<your access token> \n OR \n export OIDC_SOCK=<path to the oidc-agent socket> (usually this is already exported) \n export ORCHENT_AGENT_ACCOUNT=<account to use> \nIf you need to specify the file containing the trusted root CAs use the 'ORCHENT_CAFILE' environment variable: \n export ORCHENT_CAFILE=<path to file containing trusted CAs>\n \n").Version(OrchentVersion)
@@ -32,16 +32,20 @@ var (
3232
showDep = app.Command("depshow", "show a specific deployment")
3333
showDepUuid = showDep.Arg("uuid", "the uuid of the deployment to display").Required().String()
3434

35-
createDep = app.Command("depcreate", "create a new deployment")
36-
createDepCallback = createDep.Flag("callback", "the callback url").Default("").String()
37-
createDepTemplate = createDep.Arg("template", "the tosca template file").Required().File()
38-
createDepParameter = createDep.Arg("parameter", "the parameter to set (json object)").Required().String()
39-
40-
updateDep = app.Command("depupdate", "update the given deployment")
41-
updateDepCallback = updateDep.Flag("callback", "the callback url").Default("").String()
42-
updateDepUuid = updateDep.Arg("uuid", "the uuid of the deployment to update").Required().String()
43-
updateDepTemplate = updateDep.Arg("template", "the tosca template file").Required().File()
44-
updateDepParameter = updateDep.Arg("parameter", "the parameter to set (json object)").Required().String()
35+
createDep = app.Command("depcreate", "create a new deployment")
36+
createDepCallback = createDep.Flag("callback", "the callback url").Default("").String()
37+
createDepMaxProvidersRetry = createDep.Flag("maxProvidersRetry", "Maximum number of cloud providers to be used in case of failure (Default: UNBOUNDED).").Uint8()
38+
createDepKeepLastAttempt = createDep.Flag("keepLastAttempt", "In case of failure, keep the resources allocated in the last try (Default: true).").Default("true").Enum("true", "false")
39+
createDepTemplate = createDep.Arg("template", "the tosca template file").Required().File()
40+
createDepParameter = createDep.Arg("parameter", "the parameter to set (json object)").Required().String()
41+
42+
updateDep = app.Command("depupdate", "update the given deployment")
43+
updateDepCallback = updateDep.Flag("callback", "the callback url").Default("").String()
44+
updateDepMaxProvidersRetry = updateDep.Flag("maxProvidersRetry", "Maximum number of cloud providers to be used in case of failure (Default: UNBOUNDED).").Uint8()
45+
updateDepKeepLastAttempt = updateDep.Flag("keepLastAttempt", "In case of failure, keep the resources allocated in the last try (Default: true).").Default("true").Enum("true", "false")
46+
updateDepUuid = updateDep.Arg("uuid", "the uuid of the deployment to update").Required().String()
47+
updateDepTemplate = updateDep.Arg("template", "the tosca template file").Required().File()
48+
updateDepParameter = updateDep.Arg("parameter", "the parameter to set (json object)").Required().String()
4549

4650
depTemplate = app.Command("deptemplate", "show the template of the given deployment")
4751
templateDepUuid = depTemplate.Arg("uuid", "the uuid of the deployment to get the template").Required().String()
@@ -177,9 +181,11 @@ type OrchentResourceList struct {
177181
}
178182

179183
type OrchentCreateRequest struct {
180-
Template string `json:"template"`
181-
Parameters map[string]interface{} `json:"parameters"`
182-
Callback string `json:"callback,omitempty"`
184+
Template string `json:"template"`
185+
Parameters map[string]interface{} `json:"parameters"`
186+
Callback string `json:"callback,omitempty"`
187+
MaxProvidersRetry uint8 `json:"maxProvidersRetry,omitempty"`
188+
KeepLastAttempt string `json:"keepLastAttempt,omitempty"`
183189
}
184190

185191
func (depList OrchentDeploymentList) String() string {
@@ -371,7 +377,8 @@ func receive_and_print_deploymentlist(complete *sling.Sling, before int, after i
371377
}
372378
}
373379

374-
func deployment_create_update(templateFile *os.File, parameter string, callback string, depUuid *string, base *sling.Sling) {
380+
func deployment_create_update(templateFile *os.File, parameter string, callback string, maxProvidersRetry uint8, keepLastAttempt string, depUuid *string, base *sling.Sling) {
381+
375382
var parameterMap map[string]interface{}
376383
paramErr := json.Unmarshal([]byte(parameter), &parameterMap)
377384
if paramErr != nil {
@@ -396,6 +403,8 @@ func deployment_create_update(templateFile *os.File, parameter string, callback
396403
Template: template,
397404
Parameters: parameterMap,
398405
Callback: callback,
406+
MaxProvidersRetry: maxProvidersRetry,
407+
KeepLastAttempt: keepLastAttempt,
399408
}
400409
deployment := new(OrchentDeployment)
401410
orchentError := new(OrchentError)
@@ -700,13 +709,13 @@ func main() {
700709
case createDep.FullCommand():
701710
baseUrl := get_base_url()
702711
base := base_connection(baseUrl)
703-
deployment_create_update(*createDepTemplate, *createDepParameter, *createDepCallback, nil, base)
712+
deployment_create_update(*createDepTemplate, *createDepParameter, *createDepCallback, *createDepMaxProvidersRetry, *createDepKeepLastAttempt, nil, base)
704713

705714
case updateDep.FullCommand():
706715
baseUrl := get_base_url()
707716
base := base_connection(baseUrl)
708717
uuid := try_alias_uuid(*updateDepUuid, aliases)
709-
deployment_create_update(*updateDepTemplate, *updateDepParameter, *updateDepCallback, &uuid, base)
718+
deployment_create_update(*updateDepTemplate, *updateDepParameter, *updateDepCallback, *updateDepMaxProvidersRetry, *updateDepKeepLastAttempt, &uuid, base)
710719

711720
case depTemplate.FullCommand():
712721
baseUrl := get_base_url()

0 commit comments

Comments
 (0)