Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Latest commit

 

History

History
417 lines (289 loc) · 15.9 KB

VariablesApi.md

File metadata and controls

417 lines (289 loc) · 15.9 KB

\VariablesApi

All URIs are relative to http://127.0.0.1:4646/v1

Method HTTP request Description
DeleteVariable Delete /var/{path}
GetVariableQuery Get /var/{path}
GetVariablesListRequest Get /vars
PostVariable Post /var/{path}
PutVariable Put /var/{path}

DeleteVariable

DeleteVariable(ctx, path).Variable(variable).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Cas(cas).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    path := "path_example" // string | A path to a Nomad Variable
    variable := *openapiclient.NewVariable() // Variable | 
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional)
    cas := int32(56) // int32 | A compare-and-set parameter for Nomad Variables (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.VariablesApi.DeleteVariable(context.Background(), path).Variable(variable).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Cas(cas).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariablesApi.DeleteVariable``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
path string A path to a Nomad Variable

Other Parameters

Other parameters are passed through a pointer to a apiDeleteVariableRequest struct via the builder pattern

Name Type Description Notes

variable | Variable | | region | string | Filters results based on the specified region. | namespace | string | Filters results based on the specified namespace. | xNomadToken | string | A Nomad ACL token. | idempotencyToken | string | Can be used to ensure operations are only run once. | cas | int32 | A compare-and-set parameter for Nomad Variables |

Return type

(empty response body)

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVariableQuery

Variable GetVariableQuery(ctx, path).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    path := "path_example" // string | A path to a Nomad Variable
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    index := int32(56) // int32 | If set, wait until query exceeds given index. Must be provided with WaitParam. (optional)
    wait := "wait_example" // string | Provided with IndexParam to wait for change. (optional)
    stale := "stale_example" // string | If present, results will include stale reads. (optional)
    prefix := "prefix_example" // string | Constrains results to jobs that start with the defined prefix (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    perPage := int32(56) // int32 | Maximum number of results to return. (optional)
    nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.VariablesApi.GetVariableQuery(context.Background(), path).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariablesApi.GetVariableQuery``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetVariableQuery`: Variable
    fmt.Fprintf(os.Stdout, "Response from `VariablesApi.GetVariableQuery`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
path string A path to a Nomad Variable

Other Parameters

Other parameters are passed through a pointer to a apiGetVariableQueryRequest struct via the builder pattern

Name Type Description Notes

region | string | Filters results based on the specified region. | namespace | string | Filters results based on the specified namespace. | index | int32 | If set, wait until query exceeds given index. Must be provided with WaitParam. | wait | string | Provided with IndexParam to wait for change. | stale | string | If present, results will include stale reads. | prefix | string | Constrains results to jobs that start with the defined prefix | xNomadToken | string | A Nomad ACL token. | perPage | int32 | Maximum number of results to return. | nextToken | string | Indicates where to start paging for queries that support pagination. |

Return type

Variable

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVariablesListRequest

[]VariableMetadata GetVariablesListRequest(ctx).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    index := int32(56) // int32 | If set, wait until query exceeds given index. Must be provided with WaitParam. (optional)
    wait := "wait_example" // string | Provided with IndexParam to wait for change. (optional)
    stale := "stale_example" // string | If present, results will include stale reads. (optional)
    prefix := "prefix_example" // string | Constrains results to jobs that start with the defined prefix (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    perPage := int32(56) // int32 | Maximum number of results to return. (optional)
    nextToken := "nextToken_example" // string | Indicates where to start paging for queries that support pagination. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.VariablesApi.GetVariablesListRequest(context.Background()).Region(region).Namespace(namespace).Index(index).Wait(wait).Stale(stale).Prefix(prefix).XNomadToken(xNomadToken).PerPage(perPage).NextToken(nextToken).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariablesApi.GetVariablesListRequest``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetVariablesListRequest`: []VariableMetadata
    fmt.Fprintf(os.Stdout, "Response from `VariablesApi.GetVariablesListRequest`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetVariablesListRequestRequest struct via the builder pattern

Name Type Description Notes
region string Filters results based on the specified region.
namespace string Filters results based on the specified namespace.
index int32 If set, wait until query exceeds given index. Must be provided with WaitParam.
wait string Provided with IndexParam to wait for change.
stale string If present, results will include stale reads.
prefix string Constrains results to jobs that start with the defined prefix
xNomadToken string A Nomad ACL token.
perPage int32 Maximum number of results to return.
nextToken string Indicates where to start paging for queries that support pagination.

Return type

[]VariableMetadata

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostVariable

Variable PostVariable(ctx, path).Variable(variable).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Cas(cas).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    path := "path_example" // string | A path to a Nomad Variable
    variable := *openapiclient.NewVariable() // Variable | 
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional)
    cas := int32(56) // int32 | A compare-and-set parameter for Nomad Variables (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.VariablesApi.PostVariable(context.Background(), path).Variable(variable).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Cas(cas).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariablesApi.PostVariable``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PostVariable`: Variable
    fmt.Fprintf(os.Stdout, "Response from `VariablesApi.PostVariable`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
path string A path to a Nomad Variable

Other Parameters

Other parameters are passed through a pointer to a apiPostVariableRequest struct via the builder pattern

Name Type Description Notes

variable | Variable | | region | string | Filters results based on the specified region. | namespace | string | Filters results based on the specified namespace. | xNomadToken | string | A Nomad ACL token. | idempotencyToken | string | Can be used to ensure operations are only run once. | cas | int32 | A compare-and-set parameter for Nomad Variables |

Return type

Variable

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutVariable

Variable PutVariable(ctx, path).Variable(variable).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Cas(cas).Execute()

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    path := "path_example" // string | A path to a Nomad Variable
    variable := *openapiclient.NewVariable() // Variable | 
    region := "region_example" // string | Filters results based on the specified region. (optional)
    namespace := "namespace_example" // string | Filters results based on the specified namespace. (optional)
    xNomadToken := "xNomadToken_example" // string | A Nomad ACL token. (optional)
    idempotencyToken := "idempotencyToken_example" // string | Can be used to ensure operations are only run once. (optional)
    cas := int32(56) // int32 | A compare-and-set parameter for Nomad Variables (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.VariablesApi.PutVariable(context.Background(), path).Variable(variable).Region(region).Namespace(namespace).XNomadToken(xNomadToken).IdempotencyToken(idempotencyToken).Cas(cas).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VariablesApi.PutVariable``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PutVariable`: Variable
    fmt.Fprintf(os.Stdout, "Response from `VariablesApi.PutVariable`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
path string A path to a Nomad Variable

Other Parameters

Other parameters are passed through a pointer to a apiPutVariableRequest struct via the builder pattern

Name Type Description Notes

variable | Variable | | region | string | Filters results based on the specified region. | namespace | string | Filters results based on the specified namespace. | xNomadToken | string | A Nomad ACL token. | idempotencyToken | string | Can be used to ensure operations are only run once. | cas | int32 | A compare-and-set parameter for Nomad Variables |

Return type

Variable

Authorization

X-Nomad-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]