Documentation
¶
Index ¶
- Constants
- func WithAddress(address string) func(*Client)
- func WithCACert(caFile string) func(*Client)
- func WithClientCert(certFile, keyFile string) func(*Client)
- func WithDefaultNamespace(ns string) func(*Client)
- func WithDefaultRegion(region string) func(*Client)
- func WithTLSCerts(caFile, certFile, keyFile string) func(*Client)
- func WithTLSServerName(n string) func(*Client)
- func WithTLSSkipVerify() func(*Client)
- func WithToken(token string) func(*Client)
- type ACL
- func (a *ACL) ACLApi() *client.ACLApiService
- func (a *ACL) Bootstrap(ctx context.Context) (*client.ACLToken, *WriteMeta, OpenAPIError)
- func (a *ACL) DeletePolicy(ctx context.Context, policyName string) (*WriteMeta, OpenAPIError)
- func (a *ACL) DeleteToken(ctx context.Context, tokenAccessor string) (*WriteMeta, OpenAPIError)
- func (a *ACL) Exchange(ctx context.Context) (*client.ACLToken, *WriteMeta, OpenAPIError)
- func (a *ACL) GetPolicy(ctx context.Context, policyName string) (*client.ACLPolicy, *QueryMeta, OpenAPIError)
- func (a *ACL) GetToken(ctx context.Context, tokenAccessor string) (*client.ACLToken, *QueryMeta, OpenAPIError)
- func (a *ACL) OnetimeToken(ctx context.Context) (*client.OneTimeToken, *WriteMeta, OpenAPIError)
- func (a *ACL) Policies(ctx context.Context) (*[]client.ACLPolicyListStub, *QueryMeta, OpenAPIError)
- func (a *ACL) SavePolicy(ctx context.Context, policy *client.ACLPolicy) (*WriteMeta, OpenAPIError)
- func (a *ACL) SaveToken(ctx context.Context, token *client.ACLToken) (*client.ACLToken, *WriteMeta, OpenAPIError)
- func (a *ACL) Self(ctx context.Context) (*client.ACLToken, *QueryMeta, OpenAPIError)
- func (a *ACL) Tokens(ctx context.Context) (*[]client.ACLTokenListStub, *QueryMeta, OpenAPIError)
- type APIError
- type Allocations
- func (a *Allocations) AllocationsApi() *client.AllocationsApiService
- func (a *Allocations) GetAllocation(ctx context.Context, allocID string) (*client.Allocation, *QueryMeta, OpenAPIError)
- func (a *Allocations) GetAllocationServices(ctx context.Context, allocID string) (*[]client.ServiceRegistration, *QueryMeta, OpenAPIError)
- func (a *Allocations) GetAllocations(ctx context.Context) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
- func (a *Allocations) StopAllocation(ctx context.Context, allocID string, noShutdownDelay bool) (*client.AllocStopResponse, *WriteMeta, OpenAPIError)
- type Client
- func (c *Client) ACL() *ACL
- func (c *Client) Allocations() *Allocations
- func (c *Client) Deployments() *Deployments
- func (c *Client) Evaluations() *Evaluations
- func (c *Client) ExecNoMetaQuery(ctx context.Context, request interface{}) (interface{}, error)
- func (c *Client) ExecNoMetaWrite(ctx context.Context, request interface{}) (interface{}, error)
- func (c *Client) ExecNoResponseRequest(_ context.Context, request interface{}) *APIError
- func (c *Client) ExecNoResponseWrite(ctx context.Context, request interface{}) (*WriteMeta, *APIError)
- func (c *Client) ExecQuery(ctx context.Context, request interface{}) (interface{}, *QueryMeta, *APIError)
- func (c *Client) ExecRequest(_ context.Context, request interface{}) (interface{}, *APIError)
- func (c *Client) ExecWrite(ctx context.Context, request interface{}) (interface{}, *WriteMeta, *APIError)
- func (c *Client) Jobs() *Jobs
- func (c *Client) Metrics() *Metrics
- func (c *Client) Namespaces() *Namespaces
- func (c *Client) Operator() *Operator
- func (c *Client) Plugins() *Plugins
- func (c *Client) QueryOpts() *QueryOpts
- func (c *Client) Regions() *Regions
- func (c *Client) Scaling() *Scaling
- func (c *Client) Status() *Status
- func (c *Client) System() *System
- func (c *Client) WriteOpts() *WriteOpts
- type ClientOption
- type Deployments
- func (d *Deployments) AllocationHealth(ctx context.Context, deploymentID string, healthyallocs []string, ...) (*client.DeploymentUpdateResponse, OpenAPIError)
- func (d *Deployments) Allocations(ctx context.Context, deploymentID string) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
- func (d *Deployments) Deployments(ctx context.Context) (*[]client.Deployment, *QueryMeta, OpenAPIError)
- func (d *Deployments) DeploymentsApi() *client.DeploymentsApiService
- func (d *Deployments) Fail(ctx context.Context, deploymentID string) (*client.DeploymentUpdateResponse, OpenAPIError)
- func (d *Deployments) GetDeployment(ctx context.Context, deploymentID string) (*client.Deployment, *QueryMeta, OpenAPIError)
- func (d *Deployments) Pause(ctx context.Context, deploymentID string, pause bool) (*client.DeploymentUpdateResponse, OpenAPIError)
- func (d *Deployments) Promote(ctx context.Context, deploymentID string, all bool, groups []string) (*client.DeploymentUpdateResponse, OpenAPIError)
- func (d *Deployments) Unblock(ctx context.Context, deploymentID string) (*client.DeploymentUpdateResponse, OpenAPIError)
- type Evaluations
- func (e *Evaluations) Allocations(ctx context.Context, evalID string) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
- func (e *Evaluations) Evaluations(ctx context.Context) (*[]client.Evaluation, *QueryMeta, OpenAPIError)
- func (e *Evaluations) EvaluationsApi() *client.EvaluationsApiService
- func (e *Evaluations) GetEvaluation(ctx context.Context, evalID string) (*client.Evaluation, *QueryMeta, OpenAPIError)
- type Jobs
- func (j *Jobs) Allocations(ctx context.Context, jobName string, all bool) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
- func (j *Jobs) Delete(ctx context.Context, jobName string, purge, global bool) (*client.JobDeregisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Deployment(ctx context.Context, jobName string) (*client.Deployment, *QueryMeta, OpenAPIError)
- func (j *Jobs) Deployments(ctx context.Context, jobName string) (*[]client.Deployment, *QueryMeta, OpenAPIError)
- func (j *Jobs) Dispatch(ctx context.Context, jobName string, payload string, meta map[string]string) (*client.JobDispatchResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) EnforceRegister(ctx context.Context, job *client.Job, modifyIndex uint64) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Evaluate(ctx context.Context, jobName string, forceReschedule bool) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) GetJob(ctx context.Context, jobName string) (*client.Job, *QueryMeta, OpenAPIError)
- func (j *Jobs) GetJobs(ctx context.Context) (*[]client.JobListStub, *QueryMeta, OpenAPIError)
- func (j *Jobs) GetLocation(job *client.Job) (*time.Location, error)
- func (j *Jobs) IsMultiRegion(job *client.Job) bool
- func (j *Jobs) IsParameterized(job *client.Job) bool
- func (j *Jobs) IsPeriodic(job *client.Job) bool
- func (j *Jobs) JobsApi() *client.JobsApiService
- func (j *Jobs) Next(p *client.PeriodicConfig, fromTime time.Time) (time.Time, error)
- func (j *Jobs) Parse(ctx context.Context, hcl string, canonicalize, hclV1 bool) (*client.Job, OpenAPIError)
- func (j *Jobs) PeriodicForce(ctx context.Context, jobName string) (*client.PeriodicForceResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Plan(ctx context.Context, job *client.Job, diff bool) (*client.JobPlanResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) PlanOpts(ctx context.Context, job *client.Job, opts *PlanOpts) (*client.JobPlanResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Post(ctx context.Context, job *client.Job) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Register(ctx context.Context, job *client.Job, registerOpts *RegisterOpts) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Revert(ctx context.Context, jobName string, versionNumber, enforcePriorVersion int32, ...) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Scale(ctx context.Context, jobName string, count int64, msg string, ...) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) ScaleStatus(ctx context.Context, jobName string) (*client.JobScaleStatusResponse, *QueryMeta, OpenAPIError)
- func (j *Jobs) Stability(ctx context.Context, jobName string, versionNumber int32, stable bool) (*client.JobStabilityResponse, *WriteMeta, OpenAPIError)
- func (j *Jobs) Summary(ctx context.Context, jobName string) (*client.JobSummary, *QueryMeta, OpenAPIError)
- func (j *Jobs) Versions(ctx context.Context, jobName string, withDiffs bool) (*client.JobVersionsResponse, *QueryMeta, OpenAPIError)
- type Metrics
- type Namespaces
- func (n *Namespaces) DeleteNamespace(ctx context.Context, name string) (*WriteMeta, OpenAPIError)
- func (n *Namespaces) GetNamespace(ctx context.Context, name string) (*client.Namespace, *QueryMeta, OpenAPIError)
- func (n *Namespaces) GetNamespaces(ctx context.Context) (*[]client.Namespace, *QueryMeta, OpenAPIError)
- func (n *Namespaces) NamespacesApi() *client.NamespacesApiService
- func (n *Namespaces) PostNamespace(ctx context.Context, namespace *client.Namespace) (*WriteMeta, OpenAPIError)
- type OpenAPIError
- type Operator
- func (o *Operator) Autopilot(ctx context.Context) (*client.AutopilotConfiguration, error)
- func (o *Operator) AutopilotHealth(ctx context.Context) (*client.OperatorHealthReply, error)
- func (o *Operator) OperatorApi() *client.OperatorApiService
- func (o *Operator) Peer(ctx context.Context) error
- func (o *Operator) Raft(ctx context.Context) (*client.RaftConfiguration, error)
- func (o *Operator) Scheduler(ctx context.Context) (*client.SchedulerConfigurationResponse, *QueryMeta, error)
- func (o *Operator) UpdateAutopilot(ctx context.Context, config *client.AutopilotConfiguration) (*bool, error)
- func (o *Operator) UpdateScheduler(ctx context.Context, config *client.SchedulerConfiguration) (*client.SchedulerSetConfigurationResponse, *WriteMeta, error)
- type PlanOpts
- type Plugins
- type QueryMeta
- type QueryOpts
- func (q *QueryOpts) Ctx() context.Context
- func (q *QueryOpts) WithAllowStale(allowStale bool) *QueryOpts
- func (q *QueryOpts) WithAuthToken(authToken string) *QueryOpts
- func (q *QueryOpts) WithNamespace(namespace string) *QueryOpts
- func (q *QueryOpts) WithNextToken(nextToken string) *QueryOpts
- func (q *QueryOpts) WithPerPage(perPage int32) *QueryOpts
- func (q *QueryOpts) WithPrefix(prefix string) *QueryOpts
- func (q *QueryOpts) WithRegion(region string) *QueryOpts
- func (q *QueryOpts) WithWaitIndex(waitIndex int32) *QueryOpts
- func (q *QueryOpts) WithWaitTime(waitTime time.Duration) *QueryOpts
- type Regions
- type RegisterOpts
- type Scaling
- type Status
- type System
- type WriteMeta
- type WriteOpts
- func (w *WriteOpts) Ctx() context.Context
- func (w *WriteOpts) WithAuthToken(authToken string) *WriteOpts
- func (w *WriteOpts) WithIdempotencyToken(idempotencyToken string) *WriteOpts
- func (w *WriteOpts) WithNamespace(namespace string) *WriteOpts
- func (w *WriteOpts) WithRegion(region string) *WriteOpts
Constants ¶
const ( // JobTypeService indicates a long-running processes JobTypeService = "service" // JobTypeBatch indicates a short-lived process JobTypeBatch = "batch" // JobTypeSystem indicates a system process that should run on all clients JobTypeSystem = "system" // PeriodicSpecCron is used for a cron spec. PeriodicSpecCron = "cron" // Constants for the Nomad environment variable names. EnvNomadAddr = "NOMAD_ADDR" EnvNomadCACert = "NOMAD_CACERT" EnvNomadClientCert = "NOMAD_CLIENT_CERT" EnvNomadClientKey = "NOMAD_CLIENT_KEY" EnvNomadNamespace = "NOMAD_NAMESPACE" EnvNomadRegion = "NOMAD_REGION" EnvNomadToken = "NOMAD_TOKEN" // DefaultAddress is the default address for a Nomad cluster. This is used // when no address is provided to the client. DefaultAddress = "http://127.0.0.1:4646" // DefaultNamespace is the default namespace. DefaultNamespace = "default" // GlobalRegion is a sentinel region value dor Job configuration // that users may specify to indicate the job should be run on // the region of the node that the job was submitted to. // For Client configuration, if no region information is given, // the client node will default to be part of the GlobalRegion. GlobalRegion = "global" // RegisterEnforceIndexErrPrefix is the prefix to use in errors caused by // enforcing the job modify index during registers. RegisterEnforceIndexErrPrefix = "Enforcing job modify index" // RegionKey can be used to prevent hard coded string key accessor errors RegionKey = "Region" // NamespaceKey can be used to prevent hard coded string key accessor errors NamespaceKey = "Namespace" // ParamsKey can be used to prevent hard coded string key accessor errors ParamsKey = "Params" // PerPageKey can be used to prevent hard coded string key accessor errors PerPageKey = "PerPage" // NextTokenKey can be used to prevent hard coded string key accessor errors NextTokenKey = "NextToken" // PrefixKey can be used to prevent hard coded string key accessor errors PrefixKey = "Prefix" // AuthTokenKey can be used to prevent hard coded string key accessor errors AuthTokenKey = "AuthToken" // AllowStaleKey can be used to prevent hard coded string key accessor errors AllowStaleKey = "AllowStale" // WaitTimeKey can be used to prevent hard coded string key accessor errors WaitTimeKey = "WaitTime" // WriteIndexKey can be used to prevent hard coded string key accessor errors WaitIndexKey = "WaitIndex" // IdempotencyTokenKey can be used to prevent hard coded string key accessor errors IdempotencyTokenKey = "IdempotencyToken" )
Variables ¶
This section is empty.
Functions ¶
func WithCACert ¶
func WithClientCert ¶
func WithDefaultNamespace ¶
func WithDefaultRegion ¶
func WithTLSCerts ¶
func WithTLSServerName ¶
func WithTLSSkipVerify ¶
func WithTLSSkipVerify() func(*Client)
Types ¶
type ACL ¶
type ACL struct {
// contains filtered or unexported fields
}
func (*ACL) ACLApi ¶
func (a *ACL) ACLApi() *client.ACLApiService
func (*ACL) DeletePolicy ¶
pass in name, no payload can't use "Delete", because there's an ACL "Delete" for tokens as well
func (*ACL) DeleteToken ¶
func (*ACL) GetPolicy ¶
func (a *ACL) GetPolicy(ctx context.Context, policyName string) (*client.ACLPolicy, *QueryMeta, OpenAPIError)
returns objectSchema pass in policy name, no payload
func (*ACL) OnetimeToken ¶
func (a *ACL) OnetimeToken(ctx context.Context) (*client.OneTimeToken, *WriteMeta, OpenAPIError)
func (*ACL) Policies ¶
func (a *ACL) Policies(ctx context.Context) (*[]client.ACLPolicyListStub, *QueryMeta, OpenAPIError)
returns arraySchema
func (*ACL) SavePolicy ¶
returns nilSchema pass in policy name WITH payload can't use "Save", because there's an ACL "Save" for tokens as well
func (*ACL) Tokens ¶
func (a *ACL) Tokens(ctx context.Context) (*[]client.ACLTokenListStub, *QueryMeta, OpenAPIError)
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError Provides access to the body, error and model on returned errors. It exists to encapsulate, enhance, and extend the client.GenericOpenAPIError.
func MakeAPIError ¶
type Allocations ¶
type Allocations struct {
// contains filtered or unexported fields
}
Jobs encapsulates and extends the generated JobsApiService with convenience methods.
func (*Allocations) AllocationsApi ¶
func (a *Allocations) AllocationsApi() *client.AllocationsApiService
func (*Allocations) GetAllocation ¶
func (a *Allocations) GetAllocation(ctx context.Context, allocID string) (*client.Allocation, *QueryMeta, OpenAPIError)
func (*Allocations) GetAllocationServices ¶
func (a *Allocations) GetAllocationServices(ctx context.Context, allocID string) (*[]client.ServiceRegistration, *QueryMeta, OpenAPIError)
func (*Allocations) GetAllocations ¶
func (a *Allocations) GetAllocations(ctx context.Context) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
func (*Allocations) StopAllocation ¶
func (a *Allocations) StopAllocation(ctx context.Context, allocID string, noShutdownDelay bool) (*client.AllocStopResponse, *WriteMeta, OpenAPIError)
type Client ¶
func NewClient ¶
func NewClient(opts ...ClientOption) (*Client, error)
func (*Client) Allocations ¶
func (c *Client) Allocations() *Allocations
func (*Client) Deployments ¶
func (c *Client) Deployments() *Deployments
func (*Client) Evaluations ¶
func (c *Client) Evaluations() *Evaluations
func (*Client) ExecNoMetaQuery ¶
ExecNoMetaQuery executes a request accepts QueryOpts, but does not set index or query metadata.
func (*Client) ExecNoMetaWrite ¶
ExecNoMetaWrite executes a request accepts WriteOpts, but does not set index or write metadata.
func (*Client) ExecNoResponseRequest ¶
ExecNoResponseRequest executes a client operation that does not return a model, query or write metadata.
func (*Client) ExecNoResponseWrite ¶
func (c *Client) ExecNoResponseWrite(ctx context.Context, request interface{}) (*WriteMeta, *APIError)
ExecNoResponseWrite executes a request that returns write metadata, but no model.
func (*Client) ExecQuery ¶
func (c *Client) ExecQuery(ctx context.Context, request interface{}) (interface{}, *QueryMeta, *APIError)
ExecQuery executes a request that returns query metadata.
func (*Client) ExecRequest ¶
ExecRequest executes a client operation that does not return query or write metadata.
func (*Client) ExecWrite ¶
func (c *Client) ExecWrite(ctx context.Context, request interface{}) (interface{}, *WriteMeta, *APIError)
ExecWrite executes a request that returns write metadata.
func (*Client) Namespaces ¶
func (c *Client) Namespaces() *Namespaces
type ClientOption ¶
type ClientOption func(*Client)
type Deployments ¶
type Deployments struct {
// contains filtered or unexported fields
}
func (*Deployments) AllocationHealth ¶
func (d *Deployments) AllocationHealth(ctx context.Context, deploymentID string, healthyallocs []string, unhealthyallocs []string) (*client.DeploymentUpdateResponse, OpenAPIError)
func (*Deployments) Allocations ¶
func (d *Deployments) Allocations(ctx context.Context, deploymentID string) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
func (*Deployments) Deployments ¶
func (d *Deployments) Deployments(ctx context.Context) (*[]client.Deployment, *QueryMeta, OpenAPIError)
func (*Deployments) DeploymentsApi ¶
func (d *Deployments) DeploymentsApi() *client.DeploymentsApiService
func (*Deployments) Fail ¶
func (d *Deployments) Fail(ctx context.Context, deploymentID string) (*client.DeploymentUpdateResponse, OpenAPIError)
func (*Deployments) GetDeployment ¶
func (d *Deployments) GetDeployment(ctx context.Context, deploymentID string) (*client.Deployment, *QueryMeta, OpenAPIError)
func (*Deployments) Pause ¶
func (d *Deployments) Pause(ctx context.Context, deploymentID string, pause bool) (*client.DeploymentUpdateResponse, OpenAPIError)
func (*Deployments) Promote ¶
func (d *Deployments) Promote(ctx context.Context, deploymentID string, all bool, groups []string) (*client.DeploymentUpdateResponse, OpenAPIError)
func (*Deployments) Unblock ¶
func (d *Deployments) Unblock(ctx context.Context, deploymentID string) (*client.DeploymentUpdateResponse, OpenAPIError)
type Evaluations ¶
type Evaluations struct {
// contains filtered or unexported fields
}
func (*Evaluations) Allocations ¶
func (e *Evaluations) Allocations(ctx context.Context, evalID string) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
func (*Evaluations) Evaluations ¶
func (e *Evaluations) Evaluations(ctx context.Context) (*[]client.Evaluation, *QueryMeta, OpenAPIError)
func (*Evaluations) EvaluationsApi ¶
func (e *Evaluations) EvaluationsApi() *client.EvaluationsApiService
func (*Evaluations) GetEvaluation ¶
func (e *Evaluations) GetEvaluation(ctx context.Context, evalID string) (*client.Evaluation, *QueryMeta, OpenAPIError)
type Jobs ¶
type Jobs struct {
// contains filtered or unexported fields
}
Jobs encapsulates and extends the generated JobsApiService with convenience methods.
func (*Jobs) Allocations ¶
func (j *Jobs) Allocations(ctx context.Context, jobName string, all bool) (*[]client.AllocationListStub, *QueryMeta, OpenAPIError)
func (*Jobs) Delete ¶
func (j *Jobs) Delete(ctx context.Context, jobName string, purge, global bool) (*client.JobDeregisterResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Deployment ¶
func (j *Jobs) Deployment(ctx context.Context, jobName string) (*client.Deployment, *QueryMeta, OpenAPIError)
func (*Jobs) Deployments ¶
func (j *Jobs) Deployments(ctx context.Context, jobName string) (*[]client.Deployment, *QueryMeta, OpenAPIError)
func (*Jobs) EnforceRegister ¶
func (j *Jobs) EnforceRegister(ctx context.Context, job *client.Job, modifyIndex uint64) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Evaluate ¶
func (j *Jobs) Evaluate(ctx context.Context, jobName string, forceReschedule bool) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
func (*Jobs) GetJobs ¶
func (j *Jobs) GetJobs(ctx context.Context) (*[]client.JobListStub, *QueryMeta, OpenAPIError)
func (*Jobs) JobsApi ¶
func (j *Jobs) JobsApi() *client.JobsApiService
func (*Jobs) Next ¶
Next returns the closest time instant matching the spec that is after the passed time. If no matching instance exists, the zero value of time.Time is returned. The `time.Location` of the returned value matches that of the passed time.
func (*Jobs) PeriodicForce ¶
func (j *Jobs) PeriodicForce(ctx context.Context, jobName string) (*client.PeriodicForceResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Plan ¶
func (j *Jobs) Plan(ctx context.Context, job *client.Job, diff bool) (*client.JobPlanResponse, *WriteMeta, OpenAPIError)
func (*Jobs) PlanOpts ¶
func (j *Jobs) PlanOpts(ctx context.Context, job *client.Job, opts *PlanOpts) (*client.JobPlanResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Post ¶
func (j *Jobs) Post(ctx context.Context, job *client.Job) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Register ¶
func (j *Jobs) Register(ctx context.Context, job *client.Job, registerOpts *RegisterOpts) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Revert ¶
func (j *Jobs) Revert(ctx context.Context, jobName string, versionNumber, enforcePriorVersion int32, consulToken, vaultToken string) (*client.JobRegisterResponse, *WriteMeta, OpenAPIError)
func (*Jobs) ScaleStatus ¶
func (j *Jobs) ScaleStatus(ctx context.Context, jobName string) (*client.JobScaleStatusResponse, *QueryMeta, OpenAPIError)
func (*Jobs) Stability ¶
func (j *Jobs) Stability(ctx context.Context, jobName string, versionNumber int32, stable bool) (*client.JobStabilityResponse, *WriteMeta, OpenAPIError)
func (*Jobs) Summary ¶
func (j *Jobs) Summary(ctx context.Context, jobName string) (*client.JobSummary, *QueryMeta, OpenAPIError)
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) GetMetricsSummary ¶
func (m *Metrics) GetMetricsSummary(ctx context.Context) (*client.MetricsSummary, OpenAPIError)
func (*Metrics) MetricsApi ¶
func (m *Metrics) MetricsApi() *client.MetricsApiService
type Namespaces ¶
type Namespaces struct {
// contains filtered or unexported fields
}
func (*Namespaces) DeleteNamespace ¶
func (n *Namespaces) DeleteNamespace(ctx context.Context, name string) (*WriteMeta, OpenAPIError)
func (*Namespaces) GetNamespace ¶
func (n *Namespaces) GetNamespace(ctx context.Context, name string) (*client.Namespace, *QueryMeta, OpenAPIError)
func (*Namespaces) GetNamespaces ¶
func (n *Namespaces) GetNamespaces(ctx context.Context) (*[]client.Namespace, *QueryMeta, OpenAPIError)
func (*Namespaces) NamespacesApi ¶
func (n *Namespaces) NamespacesApi() *client.NamespacesApiService
func (*Namespaces) PostNamespace ¶
func (n *Namespaces) PostNamespace(ctx context.Context, namespace *client.Namespace) (*WriteMeta, OpenAPIError)
type OpenAPIError ¶
OpenAPIError is the interface defined by the generated client.GenericOpenAPIError. This interface allows us to return that type natively from generated code, but also to create new instances of custom types that conform to that interface so that we can return errors from generated code and user code with a consistent interface.
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
func (*Operator) AutopilotHealth ¶
func (*Operator) OperatorApi ¶
func (o *Operator) OperatorApi() *client.OperatorApiService
func (*Operator) UpdateAutopilot ¶
func (*Operator) UpdateScheduler ¶
func (o *Operator) UpdateScheduler(ctx context.Context, config *client.SchedulerConfiguration) (*client.SchedulerSetConfigurationResponse, *WriteMeta, error)
TODO: update Nomad version to pick up new fields (i.e. RejectJobRegistration)
type Plugins ¶
type Plugins struct {
// contains filtered or unexported fields
}
func (*Plugins) Get ¶
func (p *Plugins) Get(ctx context.Context) (*[]client.CSIPluginListStub, OpenAPIError)
func (*Plugins) PluginsApi ¶
func (p *Plugins) PluginsApi() *client.PluginsApiService
type QueryMeta ¶
type QueryMeta struct { // LastIndex can be used as a Index to perform // a blocking query LastIndex uint64 // LastContact is the time of last contact from the leader for the // server servicing the request LastContact time.Duration // KnownLeader indicates if there is a known leader KnownLeader bool // RequestTime is how long did the request took RequestTime time.Duration }
QueryMeta is used to return metadata about a query
type QueryOpts ¶
type QueryOpts struct { // Providing a datacenter overwrites the region provided // by the Config Region string // Namespace is the target namespace for the query. Namespace string // AllowStale allows any Nomad server (non-leader) to service // a read. This allows for lower latency and higher throughput AllowStale bool // WaitIndex is used to enable a blocking query. Waits // until the timeout or the next index is reached WaitIndex int32 // WaitTime is used to bound the duration of a call and is set in milliseconds. WaitTime time.Duration // If set, used as prefix for resource list searches Prefix string // Set HTTP parameters on the query. Params map[string]string // AuthToken is the secret ID of an ACL token AuthToken string // PerPage is the number of entries to be returned in queries that support // paginated lists. PerPage int32 // NextToken is the token used indicate where to start paging for queries // that support paginated lists. NextToken string }
QueryOpts are used to parametrize a query
func DefaultQueryOpts ¶
func DefaultQueryOpts() *QueryOpts
DefaultQueryOpts returns a QueryOpts for the default namespace and global region.
func (*QueryOpts) WithAllowStale ¶
func (*QueryOpts) WithAuthToken ¶
func (*QueryOpts) WithNamespace ¶
func (*QueryOpts) WithNextToken ¶
func (*QueryOpts) WithPerPage ¶
func (*QueryOpts) WithPrefix ¶
func (*QueryOpts) WithRegion ¶
func (*QueryOpts) WithWaitIndex ¶
type Regions ¶
type Regions struct {
// contains filtered or unexported fields
}
func (*Regions) GetRegions ¶
func (r *Regions) GetRegions(ctx context.Context) (*[]string, OpenAPIError)
func (*Regions) RegionsApi ¶
func (r *Regions) RegionsApi() *client.RegionsApiService
type RegisterOpts ¶
type Scaling ¶
type Scaling struct {
// contains filtered or unexported fields
}
func (*Scaling) GetPolicy ¶
func (s *Scaling) GetPolicy(ctx context.Context, policyID string) (*client.ScalingPolicy, *QueryMeta, OpenAPIError)
func (*Scaling) Policies ¶
func (s *Scaling) Policies(ctx context.Context) (*[]client.ScalingPolicyListStub, *QueryMeta, OpenAPIError)
func (*Scaling) ScalingApi ¶
func (s *Scaling) ScalingApi() *client.ScalingApiService
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
func (*Status) StatusApi ¶
func (s *Status) StatusApi() *client.StatusApiService
type System ¶
type System struct {
// contains filtered or unexported fields
}
func (*System) GarbageCollect ¶
func (s *System) GarbageCollect(ctx context.Context) OpenAPIError
func (*System) SystemApi ¶
func (s *System) SystemApi() *client.SystemApiService
type WriteMeta ¶
type WriteMeta struct { // LastIndex can be used as a Index to perform // a blocking query LastIndex uint64 // RequestTime is how long did the request took RequestTime time.Duration }
WriteMeta is used to return metadata about a write operation
type WriteOpts ¶
type WriteOpts struct { // Providing a datacenter overwrites the region provided // by the Config Region string // Namespace is the target namespace for the operation. Namespace string // AuthToken is the secret ID of an ACL token AuthToken string // IdempotencyToken can be used to ensure the operation is idempotent. IdempotencyToken string }
WriteOpts are used to parametrize a write operation
func DefaultWriteOpts ¶
func DefaultWriteOpts() *WriteOpts
DefaultWriteOpts returns a WriteOps for the default namespace and the global region