Commit 43982452 authored by Lukas Burgey's avatar Lukas Burgey

Change the script API

Removes the obsolete credentials field from Input.
Renames the badly named field Questionnaire to Answers in Input.
parent 91d2d788
......@@ -16,6 +16,8 @@ type (
// UserCredentialStates serves to inform the backend about the per credential states
// after the script run
// This maps a credential type like "ssh_key" to a map of the states of credentials of this
// type.
UserCredentialStates map[string]map[string]State
// UserCredentials maps a credential type to the credentials of this type
......@@ -39,42 +41,35 @@ type (
// User describes the user of this deployment task
User User `json:"user"`
// Credentials the credentials to deploy
// maps the credential type to the according credentials
//
// This is now located in Input.User.Credentials
// This field will therefore be removed in the future!
Credentials UserCredentials `json:"credentials,omitempty"`
// Questionnaire is an answered questionnaire
// Answers is an answered questionnaire
// Maps a question name to the answer of the user
// The keys (question names) *must* be identical to those of the Output.Questionnaire
// containing the questions
Questionnaire map[string]string `json:"questionnaire,omitempty"`
Answers map[string]string `json:"answers,omitempty"`
}
// Output of the deployment script
Output struct {
// State of the deployment, after the script execution
// when State == Questionnaire then Output.Questionnaire *must* be set
// when State == Deployed then Output.Credentials *can* be set
// State describes the state of the deployment, after the script execution.
// When State == Questionnaire then Output.Questionnaire *must* be set.
// When State == Deployed then Output.Credentials *can* be set.
State State `json:"state"`
// Message for the user
// Msg is a message for the user.
Msg string `json:"message"`
// Questionnaire requested by the script
// Ignored when State is not Questionnaire
// Maps a question name to a description of the question
// This field is Ignored when Output.State is not Questionnaire.
// Questionnaire maps a question name to a question.
Questionnaire map[string]string `json:"questionnaire,omitempty"`
// Credentials for the user
// Ignored when State is not Deployed
// Maps a credential name to a credential value
// Credentials are additionnal credentials for the user.
// Examples are additional passwords.
// This field is ignored by the client when Output.State is not Deployed.
// Credentials maps a credential name to a credential value.
Credentials map[string]string `json:"credentials,omitempty"`
// UserCredentialStates are the State s of the credentials found in Input.User.Credentials.
//
// This field is not mandatory. The client will assume that all credentials have the State
// Output.State if this field is not given.
UserCredentialStates UserCredentialStates `json:"user_credential_states,omitempty"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment