├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── Vagrantfile ├── checkstyle.xml ├── generator ├── README.md ├── generate.sh ├── generator.go ├── go.mod ├── go.sum ├── goapi │ └── client.go ├── java │ ├── beanproperty.go │ ├── javatype.go │ ├── lang.go │ └── types.go └── main.go ├── pom.xml ├── scripts ├── build-nomad.sh ├── create-test-certs.sh └── release.sh ├── sdk ├── findbugs-exclude.xml ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── hashicorp │ │ └── nomad │ │ ├── apimodel │ │ ├── AclPolicy.java │ │ ├── AclPolicyListStub.java │ │ ├── AclToken.java │ │ ├── AclTokenListStub.java │ │ ├── Affinity.java │ │ ├── AgentHealth.java │ │ ├── AgentHealthResponse.java │ │ ├── AgentMember.java │ │ ├── AgentSelf.java │ │ ├── AllocDeploymentStatus.java │ │ ├── AllocFileInfo.java │ │ ├── AllocResourceUsage.java │ │ ├── AllocStopResponse.java │ │ ├── AllocatedCpuResources.java │ │ ├── AllocatedMemoryResources.java │ │ ├── AllocatedResources.java │ │ ├── AllocatedSharedResources.java │ │ ├── AllocatedTaskResources.java │ │ ├── Allocation.java │ │ ├── AllocationListStub.java │ │ ├── AllocationMetric.java │ │ ├── Attribute.java │ │ ├── AutopilotConfiguration.java │ │ ├── CheckRestart.java │ │ ├── Constraint.java │ │ ├── ConsulConnect.java │ │ ├── ConsulExposeConfig.java │ │ ├── ConsulExposePath.java │ │ ├── ConsulProxy.java │ │ ├── ConsulSidecarService.java │ │ ├── ConsulUpstream.java │ │ ├── CpuStats.java │ │ ├── CsiControllerInfo.java │ │ ├── CsiInfo.java │ │ ├── CsiMountOptions.java │ │ ├── CsiNodeInfo.java │ │ ├── CsiPlugin.java │ │ ├── CsiPluginListStub.java │ │ ├── CsiTopology.java │ │ ├── CsiVolume.java │ │ ├── CsiVolumeListStub.java │ │ ├── Deployment.java │ │ ├── DeploymentState.java │ │ ├── DeploymentUpdateResponse.java │ │ ├── DesiredTransition.java │ │ ├── DesiredUpdates.java │ │ ├── DeviceGroupStats.java │ │ ├── DeviceStats.java │ │ ├── DispatchPayloadConfig.java │ │ ├── DrainSpec.java │ │ ├── DrainStrategy.java │ │ ├── DriverInfo.java │ │ ├── EphemeralDisk.java │ │ ├── Evaluation.java │ │ ├── FieldDiff.java │ │ ├── HostCpuStats.java │ │ ├── HostDiskStats.java │ │ ├── HostMemoryStats.java │ │ ├── HostStats.java │ │ ├── HostVolumeInfo.java │ │ ├── Job.java │ │ ├── JobChildrenSummary.java │ │ ├── JobDiff.java │ │ ├── JobDispatchResponse.java │ │ ├── JobListStub.java │ │ ├── JobPlanResponse.java │ │ ├── JobRegisterResponse.java │ │ ├── JobScaleStatusResponse.java │ │ ├── JobStabilityResponse.java │ │ ├── JobSummary.java │ │ ├── JobValidateResponse.java │ │ ├── KeyringResponse.java │ │ ├── License.java │ │ ├── LicenseReply.java │ │ ├── LogConfig.java │ │ ├── MemoryStats.java │ │ ├── MigrateStrategy.java │ │ ├── MonitorMessage.java │ │ ├── Namespace.java │ │ ├── NetworkResource.java │ │ ├── Node.java │ │ ├── NodeCpuResources.java │ │ ├── NodeDevice.java │ │ ├── NodeDeviceLocality.java │ │ ├── NodeDeviceResource.java │ │ ├── NodeDiskResources.java │ │ ├── NodeDrainUpdateResponse.java │ │ ├── NodeEligibilityUpdateResponse.java │ │ ├── NodeEvent.java │ │ ├── NodeListStub.java │ │ ├── NodeMemoryResources.java │ │ ├── NodeReservedCpuResources.java │ │ ├── NodeReservedDiskResources.java │ │ ├── NodeReservedMemoryResources.java │ │ ├── NodeReservedNetworkResources.java │ │ ├── NodeReservedResources.java │ │ ├── NodeResources.java │ │ ├── NodeScoreMeta.java │ │ ├── ObjectDiff.java │ │ ├── OperatorHealthReply.java │ │ ├── ParameterizedJobConfig.java │ │ ├── PeriodicConfig.java │ │ ├── PlanAnnotations.java │ │ ├── Port.java │ │ ├── PreemptionConfig.java │ │ ├── QuotaLimit.java │ │ ├── QuotaSpec.java │ │ ├── QuotaUsage.java │ │ ├── RaftConfiguration.java │ │ ├── RaftServer.java │ │ ├── RequestedDevice.java │ │ ├── RescheduleEvent.java │ │ ├── ReschedulePolicy.java │ │ ├── RescheduleTracker.java │ │ ├── ResourceUsage.java │ │ ├── Resources.java │ │ ├── RestartPolicy.java │ │ ├── ScalingEvent.java │ │ ├── ScalingPolicy.java │ │ ├── ScalingPolicyListStub.java │ │ ├── SchedulerConfiguration.java │ │ ├── SchedulerConfigurationResponse.java │ │ ├── SchedulerSetConfigurationResponse.java │ │ ├── SearchResponse.java │ │ ├── SentinelPolicy.java │ │ ├── SentinelPolicyListStub.java │ │ ├── ServerHealth.java │ │ ├── ServerMembers.java │ │ ├── Service.java │ │ ├── ServiceCheck.java │ │ ├── SidecarTask.java │ │ ├── Spread.java │ │ ├── SpreadTarget.java │ │ ├── StatObject.java │ │ ├── StatValue.java │ │ ├── StreamFrame.java │ │ ├── Task.java │ │ ├── TaskArtifact.java │ │ ├── TaskCsiPluginConfig.java │ │ ├── TaskDiff.java │ │ ├── TaskEvent.java │ │ ├── TaskGroup.java │ │ ├── TaskGroupDiff.java │ │ ├── TaskGroupScaleStatus.java │ │ ├── TaskGroupSummary.java │ │ ├── TaskLifecycle.java │ │ ├── TaskResourceUsage.java │ │ ├── TaskState.java │ │ ├── Template.java │ │ ├── UpdateStrategy.java │ │ ├── Vault.java │ │ ├── VolumeMount.java │ │ ├── VolumeRequest.java │ │ └── package-info.java │ │ └── javasdk │ │ ├── AclPoliciesApi.java │ │ ├── AclTokensApi.java │ │ ├── AgentApi.java │ │ ├── AllocationsApi.java │ │ ├── ApiBase.java │ │ ├── ApiObject.java │ │ ├── CSIPluginsApi.java │ │ ├── CSIVolumesApi.java │ │ ├── ClientApi.java │ │ ├── CustomDateDeserializer.java │ │ ├── DeploymentsApi.java │ │ ├── ErrorFoundInResponseEntityException.java │ │ ├── ErrorResponseException.java │ │ ├── EvaluationResponse.java │ │ ├── EvaluationsApi.java │ │ ├── FileStream.java │ │ ├── FramedStream.java │ │ ├── JobVersionsResponseData.java │ │ ├── JobsApi.java │ │ ├── JsonParser.java │ │ ├── NamespacesApi.java │ │ ├── NodesApi.java │ │ ├── NomadApiClient.java │ │ ├── NomadApiConfiguration.java │ │ ├── NomadException.java │ │ ├── NomadHostnameVerifier.java │ │ ├── NomadJson.java │ │ ├── NomadPredicates.java │ │ ├── NomadResponse.java │ │ ├── OperatorApi.java │ │ ├── Predicate.java │ │ ├── QueryOptions.java │ │ ├── QuotasApi.java │ │ ├── RegionsApi.java │ │ ├── RequestOptions.java │ │ ├── RequestSerializationException.java │ │ ├── ResponseAdapter.java │ │ ├── ResponseException.java │ │ ├── ResponseHeaderException.java │ │ ├── ResponseParsingException.java │ │ ├── RetryInterruptedException.java │ │ ├── ScalingApi.java │ │ ├── SearchApi.java │ │ ├── SentinelPoliciesApi.java │ │ ├── ServerQueryResponse.java │ │ ├── ServerResponse.java │ │ ├── StatusApi.java │ │ ├── SystemApi.java │ │ ├── TlsUtils.java │ │ ├── ValueExtractor.java │ │ ├── WaitStrategy.java │ │ ├── WaitStrategyExhaustedException.java │ │ ├── WriteOptions.java │ │ └── package-info.java │ └── test │ ├── java │ └── com │ │ └── hashicorp │ │ └── nomad │ │ ├── apimodel │ │ ├── ConstraintTest.java │ │ └── TaskArtifactTest.java │ │ └── javasdk │ │ └── NomadJsonTest.java │ └── resources │ └── com │ └── hashicorp │ └── nomad │ └── javasdk │ └── job.json └── testkit ├── findbugs-exclude.xml ├── pom.xml └── src ├── main └── java │ └── com │ └── hashicorp │ └── nomad │ └── testutils │ ├── AugmentedProcess.java │ ├── LinePump.java │ ├── NomadAgentConfiguration.java │ ├── NomadAgentProcess.java │ ├── TestAgent.java │ └── package-info.java └── test ├── java └── com │ └── hashicorp │ └── nomad │ ├── HangTest.java │ ├── javasdk │ ├── AclPoliciesApiTest.java │ ├── AclTokensApiTest.java │ ├── AgentApiTest.java │ ├── AllocationsApiTest.java │ ├── ApiTestBase.java │ ├── ApiTestRunner.java │ ├── ClientApiTest.java │ ├── CsiPluginTest.java │ ├── CsiVolumeTest.java │ ├── DeploymentsApiTest.java │ ├── ErrorResponseAssertion.java │ ├── EvaluationsApiTest.java │ ├── JobsApiTest.java │ ├── NamespacesApiTest.java │ ├── NodesApiTest.java │ ├── NomadApiClientTest.java │ ├── NomadApiConfigurationTest.java │ ├── OperatorApiTest.java │ ├── QuotasApiTest.java │ ├── RegionsApiTest.java │ ├── RequiresNomadEnterprise.java │ ├── SearchApiTest.java │ ├── SentinelPoliciesApiTest.java │ ├── StatusApiTest.java │ ├── SystemApiTest.java │ └── TlsTest.java │ └── testutils │ └── TestMethodLogRule.java └── resources └── com └── hashicorp └── nomad └── testutils ├── cfssl.json ├── client-key.pem ├── client.csr ├── client.pem ├── csr.json ├── nomad-ca-csr.json ├── nomad-ca-key.pem ├── nomad-ca.csr ├── nomad-ca.pem ├── sdk-key-p8.pem ├── sdk-key.pem ├── sdk.csr ├── sdk.pem ├── server-key.pem ├── server.csr └── server.pem /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea/ 3 | target/ 4 | /.vagrant/ 5 | .idea 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | sudo: false 3 | 4 | language: java 5 | 6 | before_script: 7 | - | 8 | set -euo pipefail 9 | 10 | GOPATH="$PWD/gopath" 11 | PATH="$GOPATH/bin:$PATH" 12 | 13 | java -version 14 | 15 | go version 16 | 17 | scripts/build-nomad.sh 18 | 19 | nomad -version 20 | 21 | set +euo pipefail # restore options to work around https://github.com/travis-ci/travis-ci/issues/5434 22 | 23 | cache: 24 | directories: 25 | - $GOPATH/bin 26 | - $HOME/.m2 27 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.box = "ubuntu/xenial64" 3 | config.vm.box_check_update = false 4 | 5 | config.vm.provider "virtualbox" do |v| 6 | v.memory = 4096 7 | end 8 | 9 | config.vm.provision "dependencies", type: "shell", inline: <<-SHELL 10 | apt-get update 11 | apt-get install -y git openjdk-8-jdk-headless maven gcc 12 | SHELL 13 | 14 | config.vm.provision "environment", type: "shell", inline: <<-SHELL 15 | cat >/etc/environment <<'ENVIRONMENT' 16 | GOPATH=/usr/local/gopath 17 | PATH=/usr/local/gopath/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 18 | ENVIRONMENT 19 | SHELL 20 | 21 | config.vm.provision "nomad", type: "shell", run: "always", inline: "source /etc/environment && export GOPATH && /vagrant/scripts/build-nomad.sh" 22 | end 23 | -------------------------------------------------------------------------------- /generator/README.md: -------------------------------------------------------------------------------- 1 | Java SDK Class Generator 2 | ======================== 3 | 4 | This generator code was thrown together to quickly generate classes for the 5 | Nomad Java SDK. It uses Golang reflection to scan interfaces in Nomad's `api` 6 | and generates Java classes from the Go structs it finds. 7 | 8 | 9 | Running 10 | ------- 11 | 12 | If both the nomad and nomad-java-sdk repos are in /github.com/hashicorp under 13 | your `GOPATH`, you can run the generator by running `./scripts/generate.sh` 14 | in the root directory of this repo. 15 | -------------------------------------------------------------------------------- /generator/generate.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # Generates the API model JavaBeans using reflection on the golang nomad/api package 3 | 4 | set -euo pipefail 5 | 6 | GO111MODULE=on go run *.go ../sdk/src/main/java/com/hashicorp/nomad/apimodel/ 7 | -------------------------------------------------------------------------------- /generator/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/nomad-java-sdk/generator 2 | 3 | go 1.14 4 | 5 | require github.com/hashicorp/nomad/api v0.0.0-20200605190354-0af29f74af5b 6 | -------------------------------------------------------------------------------- /generator/goapi/client.go: -------------------------------------------------------------------------------- 1 | package goapi 2 | 3 | import ( 4 | "github.com/hashicorp/nomad/api" 5 | "reflect" 6 | ) 7 | 8 | type EndpointGroup struct { 9 | t reflect.Type 10 | } 11 | 12 | func (group *EndpointGroup) VisitReturnTypes(visit func(reflect.Type)) { 13 | for i := 0; i < group.t.NumMethod(); i++ { 14 | m := group.t.Method(i) 15 | for ti := 0; ti < m.Type.NumOut(); ti++ { 16 | tt := m.Type.Out(ti) 17 | visit(tt) 18 | } 19 | } 20 | } 21 | 22 | func EndpointGroups() <-chan EndpointGroup { 23 | groups := make(chan EndpointGroup) 24 | go func() { 25 | goClient := reflect.ValueOf(&api.Client{}) 26 | for i := 0; i < goClient.NumMethod(); i++ { 27 | m := goClient.Method(i).Type() 28 | if m.NumIn() == 0 && m.NumOut() == 1 { 29 | groups <- EndpointGroup{m.Out(0)} 30 | } 31 | } 32 | close(groups) 33 | }() 34 | return groups 35 | } 36 | -------------------------------------------------------------------------------- /generator/java/javatype.go: -------------------------------------------------------------------------------- 1 | package java 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | type TypeName struct { 9 | FullyQualified string 10 | Simple string 11 | } 12 | 13 | func NewTypeName(fullyQualified string) TypeName { 14 | return TypeName{ 15 | FullyQualified: fullyQualified, 16 | Simple: fullyQualified[strings.LastIndex(fullyQualified, ".")+1:], 17 | } 18 | } 19 | 20 | type JavaType interface { 21 | Name() TypeName 22 | AsReferenceType() ReferenceType 23 | fmt.Formatter 24 | } 25 | 26 | type ReferenceType struct { 27 | name TypeName 28 | Arguments []JavaType 29 | } 30 | 31 | func NewReferenceType(fullyQualifiedName string, args ...JavaType) ReferenceType { 32 | return ReferenceType{NewTypeName(fullyQualifiedName), args} 33 | } 34 | 35 | func (t ReferenceType) Name() TypeName { return t.name } 36 | func (t ReferenceType) AsReferenceType() ReferenceType { return t } 37 | 38 | func (t ReferenceType) Format(f fmt.State, c rune) { 39 | fmt.Fprint(f, t.name.Simple) 40 | if len(t.Arguments) > 0 { 41 | fmt.Fprint(f, "<") 42 | for i, a := range t.Arguments { 43 | if i != 0 { 44 | fmt.Fprint(f, ", ") 45 | } 46 | a.AsReferenceType().Format(f, c) 47 | } 48 | fmt.Fprint(f, ">") 49 | } 50 | } 51 | 52 | type PrimitiveType struct { 53 | name string 54 | Boxed ReferenceType 55 | } 56 | 57 | func NewPrimitiveType(name string, simpleBoxedClassName string) PrimitiveType { 58 | return PrimitiveType{name, NewReferenceType("java.lang." + simpleBoxedClassName)} 59 | } 60 | 61 | func (t PrimitiveType) Name() TypeName { return TypeName{t.name, t.name} } 62 | func (t PrimitiveType) AsReferenceType() ReferenceType { return t.Boxed } 63 | 64 | func (t PrimitiveType) Format(f fmt.State, c rune) { 65 | fmt.Fprint(f, t.name) 66 | } 67 | -------------------------------------------------------------------------------- /generator/java/lang.go: -------------------------------------------------------------------------------- 1 | package java 2 | 3 | func IsKeyword(s string) bool { 4 | switch s { 5 | case "new": 6 | return true 7 | case "public": 8 | return true 9 | case "native": 10 | return true 11 | default: 12 | return false 13 | } 14 | } 15 | 16 | func IsTypeName(s string) bool { 17 | switch s { 18 | case "int": 19 | return true 20 | case "string": 21 | return true 22 | case "float": 23 | return true 24 | case "bool": 25 | return true 26 | default: 27 | return false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /generator/java/types.go: -------------------------------------------------------------------------------- 1 | package java 2 | 3 | const ( 4 | listFullyQualifiedName = "java.util.List" 5 | mapFullyQualifiedName = "java.util.Map" 6 | ) 7 | 8 | var ( 9 | PrimitiveBoolean = NewPrimitiveType("boolean", "Boolean") 10 | PrimitiveByte = NewPrimitiveType("byte", "Byte") 11 | PrimitiveShort = NewPrimitiveType("short", "Short") 12 | PrimitiveInt = NewPrimitiveType("int", "Integer") 13 | PrimitiveLong = NewPrimitiveType("long", "Long") 14 | PrimitiveFloat = NewPrimitiveType("float", "Float") 15 | PrimitiveDouble = NewPrimitiveType("double", "Double") 16 | 17 | Boolean = NewReferenceType("java.lang.Boolean") 18 | Integer = NewReferenceType("java.lang.Integer") 19 | Long = NewReferenceType("java.lang.Long") 20 | Object = NewReferenceType("java.lang.Object") 21 | String = NewReferenceType("java.lang.String") 22 | BigInteger = NewReferenceType("java.math.BigInteger") 23 | Date = NewReferenceType("java.util.Date") 24 | ) 25 | 26 | func NewListType(element JavaType) ReferenceType { 27 | return NewReferenceType(listFullyQualifiedName, element) 28 | } 29 | 30 | func NewMapType(key JavaType, value JavaType) ReferenceType { 31 | return NewReferenceType(mapFullyQualifiedName, key, value) 32 | } 33 | -------------------------------------------------------------------------------- /generator/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/hashicorp/nomad-java-sdk/generator/goapi" 5 | "github.com/hashicorp/nomad/api" 6 | "log" 7 | "os" 8 | "reflect" 9 | ) 10 | 11 | func main() { 12 | if err := os.Chdir(os.Args[1]); err != nil { 13 | log.Fatal("Not a directory:", os.Args[1]) 14 | } 15 | 16 | typesNotToGenerate := []reflect.Type{ 17 | reflect.TypeOf(api.QueryMeta{}), 18 | reflect.TypeOf(api.WriteMeta{}), 19 | } 20 | 21 | generator := NewGenerator(typesNotToGenerate) 22 | for group := range goapi.EndpointGroups() { 23 | group.VisitReturnTypes(func(t reflect.Type) { 24 | generator.ConsiderType(t) 25 | }) 26 | } 27 | generator.Close() 28 | } 29 | -------------------------------------------------------------------------------- /scripts/build-nomad.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | nomad_version=v0.12.0 5 | go_version=1.14.5 6 | 7 | cd "$(dirname "$0")/.." 8 | 9 | [ -n "${GOPATH:-}" ] || { 10 | echo "$0: error: GOPATH must be set" >&2 11 | exit 1 12 | } 13 | 14 | function expected_nomad_is_available { 15 | hash nomad 2>/dev/null && [[ "$(nomad version)" == Nomad\ *"${nomad_version}"* ]] 16 | } 17 | 18 | if expected_nomad_is_available; then 19 | echo "Nomad ${nomad_version} already available" 20 | exit 21 | fi 22 | 23 | echo "Will clone Nomad ${nomad_version} and build it with Go ${go_version}" 24 | 25 | echo "Cloning Nomad ${nomad_version}…" 26 | import_path=github.com/hashicorp/nomad 27 | worktree="$GOPATH/src/${import_path}" 28 | rm -rf "${worktree}" 29 | git clone --depth 1 --branch "${nomad_version}" "https://${import_path}" "${worktree}" 30 | 31 | echo "Getting Go ${go_version}…" 32 | eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION="${go_version}" bash)" 33 | 34 | echo "Building Nomad…" 35 | go install -tags nomad_test "${import_path}" 36 | 37 | expected_nomad_is_available || { 38 | echo "$0: error: Nomad ${nomad_version} is not available even after provisioning" >&2 39 | exit 1 40 | } 41 | 42 | echo "Nomad ${nomad_version} now available" 43 | -------------------------------------------------------------------------------- /scripts/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | [ $# -eq 2 ] || { 5 | echo "usage: $0 " 6 | echo 7 | echo "E.g: $0 0.0.1 0.0.2-SNAPSHOT" 8 | exit 2 9 | } >&2 10 | 11 | release_version="$1" 12 | next_working_version="$2" 13 | 14 | [ -z "$(git status --porcelain)" ] || { 15 | echo "Your working directoy is not pristine" 16 | echo 17 | git status 18 | exit 1 19 | } >&2 20 | 21 | mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${release_version}" 22 | git add -u 23 | mvn clean deploy -DperformRelease 24 | git commit -m "Setting version to ${release_version}" 25 | [ -z "$(git status --porcelain)" ] || { 26 | echo "Your working directory is not pristine after deploying" 27 | echo 28 | git status 29 | exit 1 30 | } >&2 31 | git tag "v${release_version}" -m "Releasing ${release_version}" 32 | 33 | mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${next_working_version}" 34 | git add -u 35 | git commit -m "Setting version to ${next_working_version}" 36 | -------------------------------------------------------------------------------- /sdk/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sdk/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | nomad-sdk 7 | 0.12.0-SNAPSHOT 8 | jar 9 | 10 | com.hashicorp.nomad 11 | nomad-sdk-parent 12 | 0.12.0-SNAPSHOT 13 | .. 14 | 15 | 16 | nomad-sdk 17 | 18 | 19 | 20 | 21 | com.fasterxml.jackson.core 22 | jackson-annotations 23 | 24 | 25 | com.fasterxml.jackson.core 26 | jackson-core 27 | 28 | 29 | com.fasterxml.jackson.core 30 | jackson-databind 31 | 32 | 33 | 34 | com.google.code.findbugs 35 | jsr305 36 | 37 | 38 | 39 | org.apache.httpcomponents 40 | httpclient 41 | 42 | 43 | 44 | org.bouncycastle 45 | bcpkix-jdk15on 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AclPolicyListStub.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class AclPolicyListStub extends ApiObject { 17 | private String name; 18 | private String description; 19 | private BigInteger createIndex; 20 | private BigInteger modifyIndex; 21 | 22 | @JsonProperty("Name") 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public AclPolicyListStub setName(String name) { 28 | this.name = name; 29 | return this; 30 | } 31 | 32 | @JsonProperty("Description") 33 | public String getDescription() { 34 | return description; 35 | } 36 | 37 | public AclPolicyListStub setDescription(String description) { 38 | this.description = description; 39 | return this; 40 | } 41 | 42 | @JsonProperty("CreateIndex") 43 | public BigInteger getCreateIndex() { 44 | return createIndex; 45 | } 46 | 47 | public AclPolicyListStub setCreateIndex(BigInteger createIndex) { 48 | this.createIndex = createIndex; 49 | return this; 50 | } 51 | 52 | @JsonProperty("ModifyIndex") 53 | public BigInteger getModifyIndex() { 54 | return modifyIndex; 55 | } 56 | 57 | public AclPolicyListStub setModifyIndex(BigInteger modifyIndex) { 58 | this.modifyIndex = modifyIndex; 59 | return this; 60 | } 61 | 62 | @Override 63 | public String toString() { 64 | return NomadJson.serialize(this); 65 | } 66 | 67 | public static AclPolicyListStub fromJson(String json) throws IOException { 68 | return NomadJson.deserialize(json, AclPolicyListStub.class); 69 | } 70 | 71 | public static List fromJsonArray(String json) throws IOException { 72 | return NomadJson.deserializeList(json, AclPolicyListStub.class); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/Affinity.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class Affinity extends ApiObject { 16 | private String lTarget; 17 | private String rTarget; 18 | private String operand; 19 | private short weight; 20 | 21 | @JsonProperty("LTarget") 22 | public String getLTarget() { 23 | return lTarget; 24 | } 25 | 26 | public Affinity setLTarget(String lTarget) { 27 | this.lTarget = lTarget; 28 | return this; 29 | } 30 | 31 | @JsonProperty("RTarget") 32 | public String getRTarget() { 33 | return rTarget; 34 | } 35 | 36 | public Affinity setRTarget(String rTarget) { 37 | this.rTarget = rTarget; 38 | return this; 39 | } 40 | 41 | @JsonProperty("Operand") 42 | public String getOperand() { 43 | return operand; 44 | } 45 | 46 | public Affinity setOperand(String operand) { 47 | this.operand = operand; 48 | return this; 49 | } 50 | 51 | @JsonProperty("Weight") 52 | public short getWeight() { 53 | return weight; 54 | } 55 | 56 | public Affinity setWeight(short weight) { 57 | this.weight = weight; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static Affinity fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, Affinity.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, Affinity.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AgentHealth.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AgentHealth extends ApiObject { 16 | private boolean ok; 17 | private String message; 18 | 19 | @JsonProperty("ok") 20 | public boolean getOk() { 21 | return ok; 22 | } 23 | 24 | public AgentHealth setOk(boolean ok) { 25 | this.ok = ok; 26 | return this; 27 | } 28 | 29 | @JsonProperty("message") 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public AgentHealth setMessage(String message) { 35 | this.message = message; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static AgentHealth fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, AgentHealth.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, AgentHealth.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AgentHealthResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AgentHealthResponse extends ApiObject { 16 | private AgentHealth client; 17 | private AgentHealth server; 18 | 19 | @JsonProperty("client") 20 | public AgentHealth getClient() { 21 | return client; 22 | } 23 | 24 | public AgentHealthResponse setClient(AgentHealth client) { 25 | this.client = client; 26 | return this; 27 | } 28 | 29 | @JsonProperty("server") 30 | public AgentHealth getServer() { 31 | return server; 32 | } 33 | 34 | public AgentHealthResponse setServer(AgentHealth server) { 35 | this.server = server; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static AgentHealthResponse fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, AgentHealthResponse.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, AgentHealthResponse.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocDeploymentStatus.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.Date; 10 | import java.util.List; 11 | 12 | /** 13 | * This is a generated JavaBean representing a request or response structure. 14 | * 15 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 16 | */ 17 | public final class AllocDeploymentStatus extends ApiObject { 18 | private Boolean healthy; 19 | private Date timestamp; 20 | private boolean canary; 21 | private BigInteger modifyIndex; 22 | 23 | @JsonProperty("Healthy") 24 | public Boolean getHealthy() { 25 | return healthy; 26 | } 27 | 28 | public AllocDeploymentStatus setHealthy(Boolean healthy) { 29 | this.healthy = healthy; 30 | return this; 31 | } 32 | 33 | @JsonProperty("Timestamp") 34 | public Date getTimestamp() { 35 | return timestamp; 36 | } 37 | 38 | public AllocDeploymentStatus setTimestamp(Date timestamp) { 39 | this.timestamp = timestamp; 40 | return this; 41 | } 42 | 43 | @JsonProperty("Canary") 44 | public boolean getCanary() { 45 | return canary; 46 | } 47 | 48 | public AllocDeploymentStatus setCanary(boolean canary) { 49 | this.canary = canary; 50 | return this; 51 | } 52 | 53 | @JsonProperty("ModifyIndex") 54 | public BigInteger getModifyIndex() { 55 | return modifyIndex; 56 | } 57 | 58 | public AllocDeploymentStatus setModifyIndex(BigInteger modifyIndex) { 59 | this.modifyIndex = modifyIndex; 60 | return this; 61 | } 62 | 63 | @Override 64 | public String toString() { 65 | return NomadJson.serialize(this); 66 | } 67 | 68 | public static AllocDeploymentStatus fromJson(String json) throws IOException { 69 | return NomadJson.deserialize(json, AllocDeploymentStatus.class); 70 | } 71 | 72 | public static List fromJsonArray(String json) throws IOException { 73 | return NomadJson.deserializeList(json, AllocDeploymentStatus.class); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocResourceUsage.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class AllocResourceUsage extends ApiObject { 17 | private ResourceUsage resourceUsage; 18 | private Map tasks; 19 | private long timestamp; 20 | 21 | @JsonProperty("ResourceUsage") 22 | public ResourceUsage getResourceUsage() { 23 | return resourceUsage; 24 | } 25 | 26 | public AllocResourceUsage setResourceUsage(ResourceUsage resourceUsage) { 27 | this.resourceUsage = resourceUsage; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Tasks") 32 | public Map getTasks() { 33 | return tasks; 34 | } 35 | 36 | public AllocResourceUsage setTasks(Map tasks) { 37 | this.tasks = tasks; 38 | return this; 39 | } 40 | 41 | public AllocResourceUsage addTasks(String key, TaskResourceUsage value) { 42 | if (this.tasks == null) 43 | this.tasks = new java.util.HashMap<>(); 44 | this.tasks.put(key, value); 45 | return this; 46 | } 47 | 48 | @JsonProperty("Timestamp") 49 | public long getTimestamp() { 50 | return timestamp; 51 | } 52 | 53 | public AllocResourceUsage setTimestamp(long timestamp) { 54 | this.timestamp = timestamp; 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static AllocResourceUsage fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, AllocResourceUsage.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, AllocResourceUsage.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocStopResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AllocStopResponse extends ApiObject { 16 | private String evalId; 17 | 18 | @JsonProperty("EvalID") 19 | public String getEvalId() { 20 | return evalId; 21 | } 22 | 23 | public AllocStopResponse setEvalId(String evalId) { 24 | this.evalId = evalId; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static AllocStopResponse fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, AllocStopResponse.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, AllocStopResponse.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocatedCpuResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AllocatedCpuResources extends ApiObject { 16 | private long cpuShares; 17 | 18 | @JsonProperty("CpuShares") 19 | public long getCpuShares() { 20 | return cpuShares; 21 | } 22 | 23 | public AllocatedCpuResources setCpuShares(long cpuShares) { 24 | this.cpuShares = cpuShares; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static AllocatedCpuResources fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, AllocatedCpuResources.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, AllocatedCpuResources.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocatedMemoryResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AllocatedMemoryResources extends ApiObject { 16 | private long memoryMb; 17 | 18 | @JsonProperty("MemoryMB") 19 | public long getMemoryMb() { 20 | return memoryMb; 21 | } 22 | 23 | public AllocatedMemoryResources setMemoryMb(long memoryMb) { 24 | this.memoryMb = memoryMb; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static AllocatedMemoryResources fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, AllocatedMemoryResources.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, AllocatedMemoryResources.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocatedResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class AllocatedResources extends ApiObject { 17 | private Map tasks; 18 | private AllocatedSharedResources shared; 19 | 20 | @JsonProperty("Tasks") 21 | public Map getTasks() { 22 | return tasks; 23 | } 24 | 25 | public AllocatedResources setTasks(Map tasks) { 26 | this.tasks = tasks; 27 | return this; 28 | } 29 | 30 | public AllocatedResources addTasks(String key, AllocatedTaskResources value) { 31 | if (this.tasks == null) 32 | this.tasks = new java.util.HashMap<>(); 33 | this.tasks.put(key, value); 34 | return this; 35 | } 36 | 37 | @JsonProperty("Shared") 38 | public AllocatedSharedResources getShared() { 39 | return shared; 40 | } 41 | 42 | public AllocatedResources setShared(AllocatedSharedResources shared) { 43 | this.shared = shared; 44 | return this; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return NomadJson.serialize(this); 50 | } 51 | 52 | public static AllocatedResources fromJson(String json) throws IOException { 53 | return NomadJson.deserialize(json, AllocatedResources.class); 54 | } 55 | 56 | public static List fromJsonArray(String json) throws IOException { 57 | return NomadJson.deserializeList(json, AllocatedResources.class); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocatedSharedResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AllocatedSharedResources extends ApiObject { 16 | private long diskMb; 17 | private List networks; 18 | 19 | @JsonProperty("DiskMB") 20 | public long getDiskMb() { 21 | return diskMb; 22 | } 23 | 24 | public AllocatedSharedResources setDiskMb(long diskMb) { 25 | this.diskMb = diskMb; 26 | return this; 27 | } 28 | 29 | @JsonProperty("Networks") 30 | public List getNetworks() { 31 | return networks; 32 | } 33 | 34 | public AllocatedSharedResources setNetworks(List networks) { 35 | this.networks = networks; 36 | return this; 37 | } 38 | 39 | public AllocatedSharedResources addNetworks(NetworkResource... networks) { 40 | if (this.networks == null) 41 | this.networks = new java.util.ArrayList<>(); 42 | for (NetworkResource item : networks) 43 | this.networks.add(item); 44 | return this; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return NomadJson.serialize(this); 50 | } 51 | 52 | public static AllocatedSharedResources fromJson(String json) throws IOException { 53 | return NomadJson.deserialize(json, AllocatedSharedResources.class); 54 | } 55 | 56 | public static List fromJsonArray(String json) throws IOException { 57 | return NomadJson.deserializeList(json, AllocatedSharedResources.class); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/AllocatedTaskResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class AllocatedTaskResources extends ApiObject { 16 | private AllocatedCpuResources cpu; 17 | private AllocatedMemoryResources memory; 18 | private List networks; 19 | 20 | @JsonProperty("Cpu") 21 | public AllocatedCpuResources getCpu() { 22 | return cpu; 23 | } 24 | 25 | public AllocatedTaskResources setCpu(AllocatedCpuResources cpu) { 26 | this.cpu = cpu; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Memory") 31 | public AllocatedMemoryResources getMemory() { 32 | return memory; 33 | } 34 | 35 | public AllocatedTaskResources setMemory(AllocatedMemoryResources memory) { 36 | this.memory = memory; 37 | return this; 38 | } 39 | 40 | @JsonProperty("Networks") 41 | public List getNetworks() { 42 | return networks; 43 | } 44 | 45 | public AllocatedTaskResources setNetworks(List networks) { 46 | this.networks = networks; 47 | return this; 48 | } 49 | 50 | public AllocatedTaskResources addNetworks(NetworkResource... networks) { 51 | if (this.networks == null) 52 | this.networks = new java.util.ArrayList<>(); 53 | for (NetworkResource item : networks) 54 | this.networks.add(item); 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static AllocatedTaskResources fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, AllocatedTaskResources.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, AllocatedTaskResources.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/Attribute.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class Attribute extends ApiObject { 16 | private double floatVal; 17 | private Long intVal; 18 | private String stringVal; 19 | private Boolean boolVal; 20 | private String unit; 21 | 22 | @JsonProperty("Float") 23 | public double getFloat() { 24 | return floatVal; 25 | } 26 | 27 | public Attribute setFloat(double floatVal) { 28 | this.floatVal = floatVal; 29 | return this; 30 | } 31 | 32 | @JsonProperty("Int") 33 | public Long getInt() { 34 | return intVal; 35 | } 36 | 37 | public Attribute setInt(Long intVal) { 38 | this.intVal = intVal; 39 | return this; 40 | } 41 | 42 | @JsonProperty("String") 43 | public String getString() { 44 | return stringVal; 45 | } 46 | 47 | public Attribute setString(String stringVal) { 48 | this.stringVal = stringVal; 49 | return this; 50 | } 51 | 52 | @JsonProperty("Bool") 53 | public Boolean getBool() { 54 | return boolVal; 55 | } 56 | 57 | public Attribute setBool(Boolean boolVal) { 58 | this.boolVal = boolVal; 59 | return this; 60 | } 61 | 62 | @JsonProperty("Unit") 63 | public String getUnit() { 64 | return unit; 65 | } 66 | 67 | public Attribute setUnit(String unit) { 68 | this.unit = unit; 69 | return this; 70 | } 71 | 72 | @Override 73 | public String toString() { 74 | return NomadJson.serialize(this); 75 | } 76 | 77 | public static Attribute fromJson(String json) throws IOException { 78 | return NomadJson.deserialize(json, Attribute.class); 79 | } 80 | 81 | public static List fromJsonArray(String json) throws IOException { 82 | return NomadJson.deserializeList(json, Attribute.class); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/CheckRestart.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class CheckRestart extends ApiObject { 16 | private int limit; 17 | private Long grace; 18 | private boolean ignoreWarnings; 19 | 20 | @JsonProperty("Limit") 21 | public int getLimit() { 22 | return limit; 23 | } 24 | 25 | public CheckRestart setLimit(int limit) { 26 | this.limit = limit; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Grace") 31 | public Long getGrace() { 32 | return grace; 33 | } 34 | 35 | public CheckRestart setGrace(Long grace) { 36 | this.grace = grace; 37 | return this; 38 | } 39 | 40 | @JsonProperty("IgnoreWarnings") 41 | public boolean getIgnoreWarnings() { 42 | return ignoreWarnings; 43 | } 44 | 45 | public CheckRestart setIgnoreWarnings(boolean ignoreWarnings) { 46 | this.ignoreWarnings = ignoreWarnings; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static CheckRestart fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, CheckRestart.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, CheckRestart.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/Constraint.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class Constraint extends ApiObject { 16 | private String lTarget; 17 | private String rTarget; 18 | private String operand; 19 | 20 | @JsonProperty("LTarget") 21 | public String getLTarget() { 22 | return lTarget; 23 | } 24 | 25 | public Constraint setLTarget(String lTarget) { 26 | this.lTarget = lTarget; 27 | return this; 28 | } 29 | 30 | @JsonProperty("RTarget") 31 | public String getRTarget() { 32 | return rTarget; 33 | } 34 | 35 | public Constraint setRTarget(String rTarget) { 36 | this.rTarget = rTarget; 37 | return this; 38 | } 39 | 40 | @JsonProperty("Operand") 41 | public String getOperand() { 42 | return operand; 43 | } 44 | 45 | public Constraint setOperand(String operand) { 46 | this.operand = operand; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static Constraint fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, Constraint.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, Constraint.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/ConsulConnect.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class ConsulConnect extends ApiObject { 16 | private boolean Native; 17 | private ConsulSidecarService sidecarService; 18 | private SidecarTask sidecarTask; 19 | 20 | @JsonProperty("Native") 21 | public boolean getNative() { 22 | return Native; 23 | } 24 | 25 | public ConsulConnect setNative(boolean Native) { 26 | this.Native = Native; 27 | return this; 28 | } 29 | 30 | @JsonProperty("SidecarService") 31 | public ConsulSidecarService getSidecarService() { 32 | return sidecarService; 33 | } 34 | 35 | public ConsulConnect setSidecarService(ConsulSidecarService sidecarService) { 36 | this.sidecarService = sidecarService; 37 | return this; 38 | } 39 | 40 | @JsonProperty("SidecarTask") 41 | public SidecarTask getSidecarTask() { 42 | return sidecarTask; 43 | } 44 | 45 | public ConsulConnect setSidecarTask(SidecarTask sidecarTask) { 46 | this.sidecarTask = sidecarTask; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static ConsulConnect fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, ConsulConnect.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, ConsulConnect.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/ConsulExposeConfig.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class ConsulExposeConfig extends ApiObject { 16 | private List path; 17 | 18 | @JsonProperty("Path") 19 | public List getPath() { 20 | return path; 21 | } 22 | 23 | public ConsulExposeConfig setPath(List path) { 24 | this.path = path; 25 | return this; 26 | } 27 | 28 | public ConsulExposeConfig addPath(ConsulExposePath... path) { 29 | if (this.path == null) 30 | this.path = new java.util.ArrayList<>(); 31 | for (ConsulExposePath item : path) 32 | this.path.add(item); 33 | return this; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return NomadJson.serialize(this); 39 | } 40 | 41 | public static ConsulExposeConfig fromJson(String json) throws IOException { 42 | return NomadJson.deserialize(json, ConsulExposeConfig.class); 43 | } 44 | 45 | public static List fromJsonArray(String json) throws IOException { 46 | return NomadJson.deserializeList(json, ConsulExposeConfig.class); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/ConsulExposePath.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class ConsulExposePath extends ApiObject { 16 | private String path; 17 | private String protocol; 18 | private int localPathPort; 19 | private String listenerPort; 20 | 21 | @JsonProperty("Path") 22 | public String getPath() { 23 | return path; 24 | } 25 | 26 | public ConsulExposePath setPath(String path) { 27 | this.path = path; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Protocol") 32 | public String getProtocol() { 33 | return protocol; 34 | } 35 | 36 | public ConsulExposePath setProtocol(String protocol) { 37 | this.protocol = protocol; 38 | return this; 39 | } 40 | 41 | @JsonProperty("LocalPathPort") 42 | public int getLocalPathPort() { 43 | return localPathPort; 44 | } 45 | 46 | public ConsulExposePath setLocalPathPort(int localPathPort) { 47 | this.localPathPort = localPathPort; 48 | return this; 49 | } 50 | 51 | @JsonProperty("ListenerPort") 52 | public String getListenerPort() { 53 | return listenerPort; 54 | } 55 | 56 | public ConsulExposePath setListenerPort(String listenerPort) { 57 | this.listenerPort = listenerPort; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static ConsulExposePath fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, ConsulExposePath.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, ConsulExposePath.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/ConsulSidecarService.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class ConsulSidecarService extends ApiObject { 16 | private List tags; 17 | private String port; 18 | private ConsulProxy proxy; 19 | 20 | @JsonProperty("Tags") 21 | public List getTags() { 22 | return tags; 23 | } 24 | 25 | public ConsulSidecarService setTags(List tags) { 26 | this.tags = tags; 27 | return this; 28 | } 29 | 30 | public ConsulSidecarService addTags(String... tags) { 31 | if (this.tags == null) 32 | this.tags = new java.util.ArrayList<>(); 33 | for (String item : tags) 34 | this.tags.add(item); 35 | return this; 36 | } 37 | 38 | @JsonProperty("Port") 39 | public String getPort() { 40 | return port; 41 | } 42 | 43 | public ConsulSidecarService setPort(String port) { 44 | this.port = port; 45 | return this; 46 | } 47 | 48 | @JsonProperty("Proxy") 49 | public ConsulProxy getProxy() { 50 | return proxy; 51 | } 52 | 53 | public ConsulSidecarService setProxy(ConsulProxy proxy) { 54 | this.proxy = proxy; 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static ConsulSidecarService fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, ConsulSidecarService.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, ConsulSidecarService.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/ConsulUpstream.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class ConsulUpstream extends ApiObject { 16 | private String destinationName; 17 | private int localBindPort; 18 | 19 | @JsonProperty("DestinationName") 20 | public String getDestinationName() { 21 | return destinationName; 22 | } 23 | 24 | public ConsulUpstream setDestinationName(String destinationName) { 25 | this.destinationName = destinationName; 26 | return this; 27 | } 28 | 29 | @JsonProperty("LocalBindPort") 30 | public int getLocalBindPort() { 31 | return localBindPort; 32 | } 33 | 34 | public ConsulUpstream setLocalBindPort(int localBindPort) { 35 | this.localBindPort = localBindPort; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static ConsulUpstream fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, ConsulUpstream.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, ConsulUpstream.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/CsiMountOptions.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class CsiMountOptions extends ApiObject { 16 | private String fsType; 17 | private List mountFlags; 18 | 19 | @JsonProperty("FSType") 20 | public String getFsType() { 21 | return fsType; 22 | } 23 | 24 | public CsiMountOptions setFsType(String fsType) { 25 | this.fsType = fsType; 26 | return this; 27 | } 28 | 29 | @JsonProperty("MountFlags") 30 | public List getMountFlags() { 31 | return mountFlags; 32 | } 33 | 34 | public CsiMountOptions setMountFlags(List mountFlags) { 35 | this.mountFlags = mountFlags; 36 | return this; 37 | } 38 | 39 | public CsiMountOptions addMountFlags(String... mountFlags) { 40 | if (this.mountFlags == null) 41 | this.mountFlags = new java.util.ArrayList<>(); 42 | for (String item : mountFlags) 43 | this.mountFlags.add(item); 44 | return this; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return NomadJson.serialize(this); 50 | } 51 | 52 | public static CsiMountOptions fromJson(String json) throws IOException { 53 | return NomadJson.deserialize(json, CsiMountOptions.class); 54 | } 55 | 56 | public static List fromJsonArray(String json) throws IOException { 57 | return NomadJson.deserializeList(json, CsiMountOptions.class); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/CsiNodeInfo.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class CsiNodeInfo extends ApiObject { 16 | private String id; 17 | private long maxVolumes; 18 | private CsiTopology accessibleTopology; 19 | private boolean requiresNodeStageVolume; 20 | 21 | @JsonProperty("ID") 22 | public String getId() { 23 | return id; 24 | } 25 | 26 | public CsiNodeInfo setId(String id) { 27 | this.id = id; 28 | return this; 29 | } 30 | 31 | @JsonProperty("MaxVolumes") 32 | public long getMaxVolumes() { 33 | return maxVolumes; 34 | } 35 | 36 | public CsiNodeInfo setMaxVolumes(long maxVolumes) { 37 | this.maxVolumes = maxVolumes; 38 | return this; 39 | } 40 | 41 | @JsonProperty("AccessibleTopology") 42 | public CsiTopology getAccessibleTopology() { 43 | return accessibleTopology; 44 | } 45 | 46 | public CsiNodeInfo setAccessibleTopology(CsiTopology accessibleTopology) { 47 | this.accessibleTopology = accessibleTopology; 48 | return this; 49 | } 50 | 51 | @JsonProperty("RequiresNodeStageVolume") 52 | public boolean getRequiresNodeStageVolume() { 53 | return requiresNodeStageVolume; 54 | } 55 | 56 | public CsiNodeInfo setRequiresNodeStageVolume(boolean requiresNodeStageVolume) { 57 | this.requiresNodeStageVolume = requiresNodeStageVolume; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static CsiNodeInfo fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, CsiNodeInfo.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, CsiNodeInfo.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/CsiTopology.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class CsiTopology extends ApiObject { 17 | private Map segments; 18 | 19 | @JsonProperty("Segments") 20 | public Map getSegments() { 21 | return segments; 22 | } 23 | 24 | public CsiTopology setSegments(Map segments) { 25 | this.segments = segments; 26 | return this; 27 | } 28 | 29 | public CsiTopology addSegments(String key, String value) { 30 | if (this.segments == null) 31 | this.segments = new java.util.HashMap<>(); 32 | this.segments.put(key, value); 33 | return this; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return NomadJson.serialize(this); 39 | } 40 | 41 | public static CsiTopology fromJson(String json) throws IOException { 42 | return NomadJson.deserialize(json, CsiTopology.class); 43 | } 44 | 45 | public static List fromJsonArray(String json) throws IOException { 46 | return NomadJson.deserializeList(json, CsiTopology.class); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/DesiredTransition.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class DesiredTransition extends ApiObject { 16 | private Boolean migrate; 17 | private Boolean reschedule; 18 | 19 | @JsonProperty("Migrate") 20 | public Boolean getMigrate() { 21 | return migrate; 22 | } 23 | 24 | public DesiredTransition setMigrate(Boolean migrate) { 25 | this.migrate = migrate; 26 | return this; 27 | } 28 | 29 | @JsonProperty("Reschedule") 30 | public Boolean getReschedule() { 31 | return reschedule; 32 | } 33 | 34 | public DesiredTransition setReschedule(Boolean reschedule) { 35 | this.reschedule = reschedule; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static DesiredTransition fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, DesiredTransition.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, DesiredTransition.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/DeviceStats.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class DeviceStats extends ApiObject { 17 | private StatValue summary; 18 | private StatObject stats; 19 | private Date timestamp; 20 | 21 | @JsonProperty("Summary") 22 | public StatValue getSummary() { 23 | return summary; 24 | } 25 | 26 | public DeviceStats setSummary(StatValue summary) { 27 | this.summary = summary; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Stats") 32 | public StatObject getStats() { 33 | return stats; 34 | } 35 | 36 | public DeviceStats setStats(StatObject stats) { 37 | this.stats = stats; 38 | return this; 39 | } 40 | 41 | @JsonProperty("Timestamp") 42 | public Date getTimestamp() { 43 | return timestamp; 44 | } 45 | 46 | public DeviceStats setTimestamp(Date timestamp) { 47 | this.timestamp = timestamp; 48 | return this; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return NomadJson.serialize(this); 54 | } 55 | 56 | public static DeviceStats fromJson(String json) throws IOException { 57 | return NomadJson.deserialize(json, DeviceStats.class); 58 | } 59 | 60 | public static List fromJsonArray(String json) throws IOException { 61 | return NomadJson.deserializeList(json, DeviceStats.class); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/DispatchPayloadConfig.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class DispatchPayloadConfig extends ApiObject { 16 | private String file; 17 | 18 | @JsonProperty("File") 19 | public String getFile() { 20 | return file; 21 | } 22 | 23 | public DispatchPayloadConfig setFile(String file) { 24 | this.file = file; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static DispatchPayloadConfig fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, DispatchPayloadConfig.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, DispatchPayloadConfig.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/DrainSpec.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class DrainSpec extends ApiObject { 16 | private long deadline; 17 | private boolean ignoreSystemJobs; 18 | 19 | @JsonProperty("Deadline") 20 | public long getDeadline() { 21 | return deadline; 22 | } 23 | 24 | public DrainSpec setDeadline(long deadline) { 25 | this.deadline = deadline; 26 | return this; 27 | } 28 | 29 | @JsonProperty("IgnoreSystemJobs") 30 | public boolean getIgnoreSystemJobs() { 31 | return ignoreSystemJobs; 32 | } 33 | 34 | public DrainSpec setIgnoreSystemJobs(boolean ignoreSystemJobs) { 35 | this.ignoreSystemJobs = ignoreSystemJobs; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static DrainSpec fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, DrainSpec.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, DrainSpec.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/DrainStrategy.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class DrainStrategy extends ApiObject { 17 | private DrainSpec drainSpec; 18 | private Date forceDeadline; 19 | private Date startedAt; 20 | 21 | @JsonProperty("DrainSpec") 22 | public DrainSpec getDrainSpec() { 23 | return drainSpec; 24 | } 25 | 26 | public DrainStrategy setDrainSpec(DrainSpec drainSpec) { 27 | this.drainSpec = drainSpec; 28 | return this; 29 | } 30 | 31 | @JsonProperty("ForceDeadline") 32 | public Date getForceDeadline() { 33 | return forceDeadline; 34 | } 35 | 36 | public DrainStrategy setForceDeadline(Date forceDeadline) { 37 | this.forceDeadline = forceDeadline; 38 | return this; 39 | } 40 | 41 | @JsonProperty("StartedAt") 42 | public Date getStartedAt() { 43 | return startedAt; 44 | } 45 | 46 | public DrainStrategy setStartedAt(Date startedAt) { 47 | this.startedAt = startedAt; 48 | return this; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return NomadJson.serialize(this); 54 | } 55 | 56 | public static DrainStrategy fromJson(String json) throws IOException { 57 | return NomadJson.deserialize(json, DrainStrategy.class); 58 | } 59 | 60 | public static List fromJsonArray(String json) throws IOException { 61 | return NomadJson.deserializeList(json, DrainStrategy.class); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/EphemeralDisk.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class EphemeralDisk extends ApiObject { 16 | private Boolean sticky; 17 | private Boolean migrate; 18 | private Integer sizeMb; 19 | 20 | @JsonProperty("Sticky") 21 | public Boolean getSticky() { 22 | return sticky; 23 | } 24 | 25 | public EphemeralDisk setSticky(Boolean sticky) { 26 | this.sticky = sticky; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Migrate") 31 | public Boolean getMigrate() { 32 | return migrate; 33 | } 34 | 35 | public EphemeralDisk setMigrate(Boolean migrate) { 36 | this.migrate = migrate; 37 | return this; 38 | } 39 | 40 | @JsonProperty("SizeMB") 41 | public Integer getSizeMb() { 42 | return sizeMb; 43 | } 44 | 45 | public EphemeralDisk setSizeMb(Integer sizeMb) { 46 | this.sizeMb = sizeMb; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static EphemeralDisk fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, EphemeralDisk.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, EphemeralDisk.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/HostCpuStats.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class HostCpuStats extends ApiObject { 16 | private String cpu; 17 | private double user; 18 | private double system; 19 | private double idle; 20 | 21 | @JsonProperty("CPU") 22 | public String getCpu() { 23 | return cpu; 24 | } 25 | 26 | public HostCpuStats setCpu(String cpu) { 27 | this.cpu = cpu; 28 | return this; 29 | } 30 | 31 | @JsonProperty("User") 32 | public double getUser() { 33 | return user; 34 | } 35 | 36 | public HostCpuStats setUser(double user) { 37 | this.user = user; 38 | return this; 39 | } 40 | 41 | @JsonProperty("System") 42 | public double getSystem() { 43 | return system; 44 | } 45 | 46 | public HostCpuStats setSystem(double system) { 47 | this.system = system; 48 | return this; 49 | } 50 | 51 | @JsonProperty("Idle") 52 | public double getIdle() { 53 | return idle; 54 | } 55 | 56 | public HostCpuStats setIdle(double idle) { 57 | this.idle = idle; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static HostCpuStats fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, HostCpuStats.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, HostCpuStats.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/HostMemoryStats.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class HostMemoryStats extends ApiObject { 17 | private BigInteger total; 18 | private BigInteger available; 19 | private BigInteger used; 20 | private BigInteger free; 21 | 22 | @JsonProperty("Total") 23 | public BigInteger getTotal() { 24 | return total; 25 | } 26 | 27 | public HostMemoryStats setTotal(BigInteger total) { 28 | this.total = total; 29 | return this; 30 | } 31 | 32 | @JsonProperty("Available") 33 | public BigInteger getAvailable() { 34 | return available; 35 | } 36 | 37 | public HostMemoryStats setAvailable(BigInteger available) { 38 | this.available = available; 39 | return this; 40 | } 41 | 42 | @JsonProperty("Used") 43 | public BigInteger getUsed() { 44 | return used; 45 | } 46 | 47 | public HostMemoryStats setUsed(BigInteger used) { 48 | this.used = used; 49 | return this; 50 | } 51 | 52 | @JsonProperty("Free") 53 | public BigInteger getFree() { 54 | return free; 55 | } 56 | 57 | public HostMemoryStats setFree(BigInteger free) { 58 | this.free = free; 59 | return this; 60 | } 61 | 62 | @Override 63 | public String toString() { 64 | return NomadJson.serialize(this); 65 | } 66 | 67 | public static HostMemoryStats fromJson(String json) throws IOException { 68 | return NomadJson.deserialize(json, HostMemoryStats.class); 69 | } 70 | 71 | public static List fromJsonArray(String json) throws IOException { 72 | return NomadJson.deserializeList(json, HostMemoryStats.class); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/HostVolumeInfo.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class HostVolumeInfo extends ApiObject { 16 | private String path; 17 | private boolean readOnly; 18 | 19 | @JsonProperty("Path") 20 | public String getPath() { 21 | return path; 22 | } 23 | 24 | public HostVolumeInfo setPath(String path) { 25 | this.path = path; 26 | return this; 27 | } 28 | 29 | @JsonProperty("ReadOnly") 30 | public boolean getReadOnly() { 31 | return readOnly; 32 | } 33 | 34 | public HostVolumeInfo setReadOnly(boolean readOnly) { 35 | this.readOnly = readOnly; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static HostVolumeInfo fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, HostVolumeInfo.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, HostVolumeInfo.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/JobChildrenSummary.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class JobChildrenSummary extends ApiObject { 16 | private long pending; 17 | private long running; 18 | private long dead; 19 | 20 | @JsonProperty("Pending") 21 | public long getPending() { 22 | return pending; 23 | } 24 | 25 | public JobChildrenSummary setPending(long pending) { 26 | this.pending = pending; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Running") 31 | public long getRunning() { 32 | return running; 33 | } 34 | 35 | public JobChildrenSummary setRunning(long running) { 36 | this.running = running; 37 | return this; 38 | } 39 | 40 | @JsonProperty("Dead") 41 | public long getDead() { 42 | return dead; 43 | } 44 | 45 | public JobChildrenSummary setDead(long dead) { 46 | this.dead = dead; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static JobChildrenSummary fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, JobChildrenSummary.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, JobChildrenSummary.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/JobRegisterResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class JobRegisterResponse extends ApiObject { 17 | private String evalId; 18 | private BigInteger evalCreateIndex; 19 | private BigInteger jobModifyIndex; 20 | private String warnings; 21 | 22 | @JsonProperty("EvalID") 23 | public String getEvalId() { 24 | return evalId; 25 | } 26 | 27 | public JobRegisterResponse setEvalId(String evalId) { 28 | this.evalId = evalId; 29 | return this; 30 | } 31 | 32 | @JsonProperty("EvalCreateIndex") 33 | public BigInteger getEvalCreateIndex() { 34 | return evalCreateIndex; 35 | } 36 | 37 | public JobRegisterResponse setEvalCreateIndex(BigInteger evalCreateIndex) { 38 | this.evalCreateIndex = evalCreateIndex; 39 | return this; 40 | } 41 | 42 | @JsonProperty("JobModifyIndex") 43 | public BigInteger getJobModifyIndex() { 44 | return jobModifyIndex; 45 | } 46 | 47 | public JobRegisterResponse setJobModifyIndex(BigInteger jobModifyIndex) { 48 | this.jobModifyIndex = jobModifyIndex; 49 | return this; 50 | } 51 | 52 | @JsonProperty("Warnings") 53 | public String getWarnings() { 54 | return warnings; 55 | } 56 | 57 | public JobRegisterResponse setWarnings(String warnings) { 58 | this.warnings = warnings; 59 | return this; 60 | } 61 | 62 | @Override 63 | public String toString() { 64 | return NomadJson.serialize(this); 65 | } 66 | 67 | public static JobRegisterResponse fromJson(String json) throws IOException { 68 | return NomadJson.deserialize(json, JobRegisterResponse.class); 69 | } 70 | 71 | public static List fromJsonArray(String json) throws IOException { 72 | return NomadJson.deserializeList(json, JobRegisterResponse.class); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/JobStabilityResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class JobStabilityResponse extends ApiObject { 17 | private BigInteger jobModifyIndex; 18 | 19 | @JsonProperty("JobModifyIndex") 20 | public BigInteger getJobModifyIndex() { 21 | return jobModifyIndex; 22 | } 23 | 24 | public JobStabilityResponse setJobModifyIndex(BigInteger jobModifyIndex) { 25 | this.jobModifyIndex = jobModifyIndex; 26 | return this; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return NomadJson.serialize(this); 32 | } 33 | 34 | public static JobStabilityResponse fromJson(String json) throws IOException { 35 | return NomadJson.deserialize(json, JobStabilityResponse.class); 36 | } 37 | 38 | public static List fromJsonArray(String json) throws IOException { 39 | return NomadJson.deserializeList(json, JobStabilityResponse.class); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/LicenseReply.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class LicenseReply extends ApiObject { 16 | private License license; 17 | 18 | @JsonProperty("License") 19 | public License getLicense() { 20 | return license; 21 | } 22 | 23 | public LicenseReply setLicense(License license) { 24 | this.license = license; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static LicenseReply fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, LicenseReply.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, LicenseReply.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/LogConfig.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class LogConfig extends ApiObject { 16 | private Integer maxFiles; 17 | private Integer maxFileSizeMb; 18 | 19 | @JsonProperty("MaxFiles") 20 | public Integer getMaxFiles() { 21 | return maxFiles; 22 | } 23 | 24 | public LogConfig setMaxFiles(Integer maxFiles) { 25 | this.maxFiles = maxFiles; 26 | return this; 27 | } 28 | 29 | @JsonProperty("MaxFileSizeMB") 30 | public Integer getMaxFileSizeMb() { 31 | return maxFileSizeMb; 32 | } 33 | 34 | public LogConfig setMaxFileSizeMb(Integer maxFileSizeMb) { 35 | this.maxFileSizeMb = maxFileSizeMb; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static LogConfig fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, LogConfig.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, LogConfig.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/MigrateStrategy.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class MigrateStrategy extends ApiObject { 16 | private Integer maxParallel; 17 | private String healthCheck; 18 | private Long minHealthyTime; 19 | private Long healthyDeadline; 20 | 21 | @JsonProperty("MaxParallel") 22 | public Integer getMaxParallel() { 23 | return maxParallel; 24 | } 25 | 26 | public MigrateStrategy setMaxParallel(Integer maxParallel) { 27 | this.maxParallel = maxParallel; 28 | return this; 29 | } 30 | 31 | @JsonProperty("HealthCheck") 32 | public String getHealthCheck() { 33 | return healthCheck; 34 | } 35 | 36 | public MigrateStrategy setHealthCheck(String healthCheck) { 37 | this.healthCheck = healthCheck; 38 | return this; 39 | } 40 | 41 | @JsonProperty("MinHealthyTime") 42 | public Long getMinHealthyTime() { 43 | return minHealthyTime; 44 | } 45 | 46 | public MigrateStrategy setMinHealthyTime(Long minHealthyTime) { 47 | this.minHealthyTime = minHealthyTime; 48 | return this; 49 | } 50 | 51 | @JsonProperty("HealthyDeadline") 52 | public Long getHealthyDeadline() { 53 | return healthyDeadline; 54 | } 55 | 56 | public MigrateStrategy setHealthyDeadline(Long healthyDeadline) { 57 | this.healthyDeadline = healthyDeadline; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static MigrateStrategy fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, MigrateStrategy.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, MigrateStrategy.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/MonitorMessage.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class MonitorMessage extends ApiObject { 16 | private Integer level; 17 | private String message; 18 | 19 | @JsonProperty("Level") 20 | public Integer getLevel() { 21 | return level; 22 | } 23 | 24 | public MonitorMessage setLevel(Integer level) { 25 | this.level = level; 26 | return this; 27 | } 28 | 29 | @JsonProperty("Message") 30 | public String getMessage() { 31 | return message; 32 | } 33 | 34 | public MonitorMessage setMessage(String message) { 35 | this.message = message; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static MonitorMessage fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, MonitorMessage.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, MonitorMessage.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeCpuResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class NodeCpuResources extends ApiObject { 16 | private long cpuShares; 17 | 18 | @JsonProperty("CpuShares") 19 | public long getCpuShares() { 20 | return cpuShares; 21 | } 22 | 23 | public NodeCpuResources setCpuShares(long cpuShares) { 24 | this.cpuShares = cpuShares; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static NodeCpuResources fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, NodeCpuResources.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, NodeCpuResources.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeDevice.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class NodeDevice extends ApiObject { 16 | private String id; 17 | private boolean healthy; 18 | private String healthDescription; 19 | private NodeDeviceLocality locality; 20 | 21 | @JsonProperty("ID") 22 | public String getId() { 23 | return id; 24 | } 25 | 26 | public NodeDevice setId(String id) { 27 | this.id = id; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Healthy") 32 | public boolean getHealthy() { 33 | return healthy; 34 | } 35 | 36 | public NodeDevice setHealthy(boolean healthy) { 37 | this.healthy = healthy; 38 | return this; 39 | } 40 | 41 | @JsonProperty("HealthDescription") 42 | public String getHealthDescription() { 43 | return healthDescription; 44 | } 45 | 46 | public NodeDevice setHealthDescription(String healthDescription) { 47 | this.healthDescription = healthDescription; 48 | return this; 49 | } 50 | 51 | @JsonProperty("Locality") 52 | public NodeDeviceLocality getLocality() { 53 | return locality; 54 | } 55 | 56 | public NodeDevice setLocality(NodeDeviceLocality locality) { 57 | this.locality = locality; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static NodeDevice fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, NodeDevice.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, NodeDevice.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeDeviceLocality.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class NodeDeviceLocality extends ApiObject { 16 | private String pciBusId; 17 | 18 | @JsonProperty("PciBusID") 19 | public String getPciBusId() { 20 | return pciBusId; 21 | } 22 | 23 | public NodeDeviceLocality setPciBusId(String pciBusId) { 24 | this.pciBusId = pciBusId; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static NodeDeviceLocality fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, NodeDeviceLocality.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, NodeDeviceLocality.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeDiskResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class NodeDiskResources extends ApiObject { 16 | private long diskMb; 17 | 18 | @JsonProperty("DiskMB") 19 | public long getDiskMb() { 20 | return diskMb; 21 | } 22 | 23 | public NodeDiskResources setDiskMb(long diskMb) { 24 | this.diskMb = diskMb; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static NodeDiskResources fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, NodeDiskResources.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, NodeDiskResources.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeMemoryResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class NodeMemoryResources extends ApiObject { 16 | private long memoryMb; 17 | 18 | @JsonProperty("MemoryMB") 19 | public long getMemoryMb() { 20 | return memoryMb; 21 | } 22 | 23 | public NodeMemoryResources setMemoryMb(long memoryMb) { 24 | this.memoryMb = memoryMb; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static NodeMemoryResources fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, NodeMemoryResources.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, NodeMemoryResources.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeReservedCpuResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class NodeReservedCpuResources extends ApiObject { 17 | private BigInteger cpuShares; 18 | 19 | @JsonProperty("CpuShares") 20 | public BigInteger getCpuShares() { 21 | return cpuShares; 22 | } 23 | 24 | public NodeReservedCpuResources setCpuShares(BigInteger cpuShares) { 25 | this.cpuShares = cpuShares; 26 | return this; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return NomadJson.serialize(this); 32 | } 33 | 34 | public static NodeReservedCpuResources fromJson(String json) throws IOException { 35 | return NomadJson.deserialize(json, NodeReservedCpuResources.class); 36 | } 37 | 38 | public static List fromJsonArray(String json) throws IOException { 39 | return NomadJson.deserializeList(json, NodeReservedCpuResources.class); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeReservedDiskResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class NodeReservedDiskResources extends ApiObject { 17 | private BigInteger diskMb; 18 | 19 | @JsonProperty("DiskMB") 20 | public BigInteger getDiskMb() { 21 | return diskMb; 22 | } 23 | 24 | public NodeReservedDiskResources setDiskMb(BigInteger diskMb) { 25 | this.diskMb = diskMb; 26 | return this; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return NomadJson.serialize(this); 32 | } 33 | 34 | public static NodeReservedDiskResources fromJson(String json) throws IOException { 35 | return NomadJson.deserialize(json, NodeReservedDiskResources.class); 36 | } 37 | 38 | public static List fromJsonArray(String json) throws IOException { 39 | return NomadJson.deserializeList(json, NodeReservedDiskResources.class); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeReservedMemoryResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class NodeReservedMemoryResources extends ApiObject { 17 | private BigInteger memoryMb; 18 | 19 | @JsonProperty("MemoryMB") 20 | public BigInteger getMemoryMb() { 21 | return memoryMb; 22 | } 23 | 24 | public NodeReservedMemoryResources setMemoryMb(BigInteger memoryMb) { 25 | this.memoryMb = memoryMb; 26 | return this; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return NomadJson.serialize(this); 32 | } 33 | 34 | public static NodeReservedMemoryResources fromJson(String json) throws IOException { 35 | return NomadJson.deserialize(json, NodeReservedMemoryResources.class); 36 | } 37 | 38 | public static List fromJsonArray(String json) throws IOException { 39 | return NomadJson.deserializeList(json, NodeReservedMemoryResources.class); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeReservedNetworkResources.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class NodeReservedNetworkResources extends ApiObject { 16 | private String reservedHostPorts; 17 | 18 | @JsonProperty("ReservedHostPorts") 19 | public String getReservedHostPorts() { 20 | return reservedHostPorts; 21 | } 22 | 23 | public NodeReservedNetworkResources setReservedHostPorts(String reservedHostPorts) { 24 | this.reservedHostPorts = reservedHostPorts; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static NodeReservedNetworkResources fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, NodeReservedNetworkResources.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, NodeReservedNetworkResources.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/NodeScoreMeta.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class NodeScoreMeta extends ApiObject { 17 | private String nodeId; 18 | private Map scores; 19 | private double normScore; 20 | 21 | @JsonProperty("NodeID") 22 | public String getNodeId() { 23 | return nodeId; 24 | } 25 | 26 | public NodeScoreMeta setNodeId(String nodeId) { 27 | this.nodeId = nodeId; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Scores") 32 | public Map getScores() { 33 | return scores; 34 | } 35 | 36 | public NodeScoreMeta setScores(Map scores) { 37 | this.scores = scores; 38 | return this; 39 | } 40 | 41 | public NodeScoreMeta addScores(String key, double value) { 42 | if (this.scores == null) 43 | this.scores = new java.util.HashMap<>(); 44 | this.scores.put(key, value); 45 | return this; 46 | } 47 | 48 | @JsonProperty("NormScore") 49 | public double getNormScore() { 50 | return normScore; 51 | } 52 | 53 | public NodeScoreMeta setNormScore(double normScore) { 54 | this.normScore = normScore; 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static NodeScoreMeta fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, NodeScoreMeta.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, NodeScoreMeta.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/OperatorHealthReply.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class OperatorHealthReply extends ApiObject { 16 | private boolean healthy; 17 | private int failureTolerance; 18 | private List servers; 19 | 20 | @JsonProperty("Healthy") 21 | public boolean getHealthy() { 22 | return healthy; 23 | } 24 | 25 | public OperatorHealthReply setHealthy(boolean healthy) { 26 | this.healthy = healthy; 27 | return this; 28 | } 29 | 30 | @JsonProperty("FailureTolerance") 31 | public int getFailureTolerance() { 32 | return failureTolerance; 33 | } 34 | 35 | public OperatorHealthReply setFailureTolerance(int failureTolerance) { 36 | this.failureTolerance = failureTolerance; 37 | return this; 38 | } 39 | 40 | @JsonProperty("Servers") 41 | public List getServers() { 42 | return servers; 43 | } 44 | 45 | public OperatorHealthReply setServers(List servers) { 46 | this.servers = servers; 47 | return this; 48 | } 49 | 50 | public OperatorHealthReply addServers(ServerHealth... servers) { 51 | if (this.servers == null) 52 | this.servers = new java.util.ArrayList<>(); 53 | for (ServerHealth item : servers) 54 | this.servers.add(item); 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static OperatorHealthReply fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, OperatorHealthReply.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, OperatorHealthReply.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/Port.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class Port extends ApiObject { 16 | private String label; 17 | private int value; 18 | private int to; 19 | 20 | @JsonProperty("Label") 21 | public String getLabel() { 22 | return label; 23 | } 24 | 25 | public Port setLabel(String label) { 26 | this.label = label; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Value") 31 | public int getValue() { 32 | return value; 33 | } 34 | 35 | public Port setValue(int value) { 36 | this.value = value; 37 | return this; 38 | } 39 | 40 | @JsonProperty("To") 41 | public int getTo() { 42 | return to; 43 | } 44 | 45 | public Port setTo(int to) { 46 | this.to = to; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static Port fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, Port.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, Port.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/PreemptionConfig.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class PreemptionConfig extends ApiObject { 16 | private boolean systemSchedulerEnabled; 17 | private boolean batchSchedulerEnabled; 18 | private boolean serviceSchedulerEnabled; 19 | 20 | @JsonProperty("SystemSchedulerEnabled") 21 | public boolean getSystemSchedulerEnabled() { 22 | return systemSchedulerEnabled; 23 | } 24 | 25 | public PreemptionConfig setSystemSchedulerEnabled(boolean systemSchedulerEnabled) { 26 | this.systemSchedulerEnabled = systemSchedulerEnabled; 27 | return this; 28 | } 29 | 30 | @JsonProperty("BatchSchedulerEnabled") 31 | public boolean getBatchSchedulerEnabled() { 32 | return batchSchedulerEnabled; 33 | } 34 | 35 | public PreemptionConfig setBatchSchedulerEnabled(boolean batchSchedulerEnabled) { 36 | this.batchSchedulerEnabled = batchSchedulerEnabled; 37 | return this; 38 | } 39 | 40 | @JsonProperty("ServiceSchedulerEnabled") 41 | public boolean getServiceSchedulerEnabled() { 42 | return serviceSchedulerEnabled; 43 | } 44 | 45 | public PreemptionConfig setServiceSchedulerEnabled(boolean serviceSchedulerEnabled) { 46 | this.serviceSchedulerEnabled = serviceSchedulerEnabled; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static PreemptionConfig fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, PreemptionConfig.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, PreemptionConfig.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/QuotaLimit.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class QuotaLimit extends ApiObject { 16 | private String region; 17 | private Resources regionLimit; 18 | private byte[] hash; 19 | 20 | @JsonProperty("Region") 21 | public String getRegion() { 22 | return region; 23 | } 24 | 25 | public QuotaLimit setRegion(String region) { 26 | this.region = region; 27 | return this; 28 | } 29 | 30 | @JsonProperty("RegionLimit") 31 | public Resources getRegionLimit() { 32 | return regionLimit; 33 | } 34 | 35 | public QuotaLimit setRegionLimit(Resources regionLimit) { 36 | this.regionLimit = regionLimit; 37 | return this; 38 | } 39 | 40 | @JsonProperty("Hash") 41 | public byte[] getHash() { 42 | return hash; 43 | } 44 | 45 | public QuotaLimit setHash(byte[] hash) { 46 | this.hash = hash; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static QuotaLimit fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, QuotaLimit.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, QuotaLimit.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/RaftConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.math.BigInteger; 9 | import java.util.List; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class RaftConfiguration extends ApiObject { 17 | private List servers; 18 | private BigInteger index; 19 | 20 | @JsonProperty("Servers") 21 | public List getServers() { 22 | return servers; 23 | } 24 | 25 | public RaftConfiguration setServers(List servers) { 26 | this.servers = servers; 27 | return this; 28 | } 29 | 30 | public RaftConfiguration addServers(RaftServer... servers) { 31 | if (this.servers == null) 32 | this.servers = new java.util.ArrayList<>(); 33 | for (RaftServer item : servers) 34 | this.servers.add(item); 35 | return this; 36 | } 37 | 38 | @JsonProperty("Index") 39 | public BigInteger getIndex() { 40 | return index; 41 | } 42 | 43 | public RaftConfiguration setIndex(BigInteger index) { 44 | this.index = index; 45 | return this; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return NomadJson.serialize(this); 51 | } 52 | 53 | public static RaftConfiguration fromJson(String json) throws IOException { 54 | return NomadJson.deserialize(json, RaftConfiguration.class); 55 | } 56 | 57 | public static List fromJsonArray(String json) throws IOException { 58 | return NomadJson.deserializeList(json, RaftConfiguration.class); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/RescheduleEvent.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class RescheduleEvent extends ApiObject { 16 | private long rescheduleTime; 17 | private String prevAllocId; 18 | private String prevNodeId; 19 | 20 | @JsonProperty("RescheduleTime") 21 | public long getRescheduleTime() { 22 | return rescheduleTime; 23 | } 24 | 25 | public RescheduleEvent setRescheduleTime(long rescheduleTime) { 26 | this.rescheduleTime = rescheduleTime; 27 | return this; 28 | } 29 | 30 | @JsonProperty("PrevAllocID") 31 | public String getPrevAllocId() { 32 | return prevAllocId; 33 | } 34 | 35 | public RescheduleEvent setPrevAllocId(String prevAllocId) { 36 | this.prevAllocId = prevAllocId; 37 | return this; 38 | } 39 | 40 | @JsonProperty("PrevNodeID") 41 | public String getPrevNodeId() { 42 | return prevNodeId; 43 | } 44 | 45 | public RescheduleEvent setPrevNodeId(String prevNodeId) { 46 | this.prevNodeId = prevNodeId; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static RescheduleEvent fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, RescheduleEvent.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, RescheduleEvent.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/RescheduleTracker.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class RescheduleTracker extends ApiObject { 16 | private List events; 17 | 18 | @JsonProperty("Events") 19 | public List getEvents() { 20 | return events; 21 | } 22 | 23 | public RescheduleTracker setEvents(List events) { 24 | this.events = events; 25 | return this; 26 | } 27 | 28 | public RescheduleTracker addEvents(RescheduleEvent... events) { 29 | if (this.events == null) 30 | this.events = new java.util.ArrayList<>(); 31 | for (RescheduleEvent item : events) 32 | this.events.add(item); 33 | return this; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return NomadJson.serialize(this); 39 | } 40 | 41 | public static RescheduleTracker fromJson(String json) throws IOException { 42 | return NomadJson.deserialize(json, RescheduleTracker.class); 43 | } 44 | 45 | public static List fromJsonArray(String json) throws IOException { 46 | return NomadJson.deserializeList(json, RescheduleTracker.class); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/ResourceUsage.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class ResourceUsage extends ApiObject { 16 | private MemoryStats memoryStats; 17 | private CpuStats cpuStats; 18 | private List deviceStats; 19 | 20 | @JsonProperty("MemoryStats") 21 | public MemoryStats getMemoryStats() { 22 | return memoryStats; 23 | } 24 | 25 | public ResourceUsage setMemoryStats(MemoryStats memoryStats) { 26 | this.memoryStats = memoryStats; 27 | return this; 28 | } 29 | 30 | @JsonProperty("CpuStats") 31 | public CpuStats getCpuStats() { 32 | return cpuStats; 33 | } 34 | 35 | public ResourceUsage setCpuStats(CpuStats cpuStats) { 36 | this.cpuStats = cpuStats; 37 | return this; 38 | } 39 | 40 | @JsonProperty("DeviceStats") 41 | public List getDeviceStats() { 42 | return deviceStats; 43 | } 44 | 45 | public ResourceUsage setDeviceStats(List deviceStats) { 46 | this.deviceStats = deviceStats; 47 | return this; 48 | } 49 | 50 | public ResourceUsage addDeviceStats(DeviceGroupStats... deviceStats) { 51 | if (this.deviceStats == null) 52 | this.deviceStats = new java.util.ArrayList<>(); 53 | for (DeviceGroupStats item : deviceStats) 54 | this.deviceStats.add(item); 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static ResourceUsage fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, ResourceUsage.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, ResourceUsage.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/RestartPolicy.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class RestartPolicy extends ApiObject { 16 | private Long interval; 17 | private Integer attempts; 18 | private Long delay; 19 | private String mode; 20 | 21 | @JsonProperty("Interval") 22 | public Long getInterval() { 23 | return interval; 24 | } 25 | 26 | public RestartPolicy setInterval(Long interval) { 27 | this.interval = interval; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Attempts") 32 | public Integer getAttempts() { 33 | return attempts; 34 | } 35 | 36 | public RestartPolicy setAttempts(Integer attempts) { 37 | this.attempts = attempts; 38 | return this; 39 | } 40 | 41 | @JsonProperty("Delay") 42 | public Long getDelay() { 43 | return delay; 44 | } 45 | 46 | public RestartPolicy setDelay(Long delay) { 47 | this.delay = delay; 48 | return this; 49 | } 50 | 51 | @JsonProperty("Mode") 52 | public String getMode() { 53 | return mode; 54 | } 55 | 56 | public RestartPolicy setMode(String mode) { 57 | this.mode = mode; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static RestartPolicy fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, RestartPolicy.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, RestartPolicy.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/SchedulerConfigurationResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class SchedulerConfigurationResponse extends ApiObject { 16 | private SchedulerConfiguration schedulerConfig; 17 | 18 | @JsonProperty("SchedulerConfig") 19 | public SchedulerConfiguration getSchedulerConfig() { 20 | return schedulerConfig; 21 | } 22 | 23 | public SchedulerConfigurationResponse setSchedulerConfig(SchedulerConfiguration schedulerConfig) { 24 | this.schedulerConfig = schedulerConfig; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static SchedulerConfigurationResponse fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, SchedulerConfigurationResponse.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, SchedulerConfigurationResponse.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/SchedulerSetConfigurationResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class SchedulerSetConfigurationResponse extends ApiObject { 16 | private boolean updated; 17 | 18 | @JsonProperty("Updated") 19 | public boolean getUpdated() { 20 | return updated; 21 | } 22 | 23 | public SchedulerSetConfigurationResponse setUpdated(boolean updated) { 24 | this.updated = updated; 25 | return this; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return NomadJson.serialize(this); 31 | } 32 | 33 | public static SchedulerSetConfigurationResponse fromJson(String json) throws IOException { 34 | return NomadJson.deserialize(json, SchedulerSetConfigurationResponse.class); 35 | } 36 | 37 | public static List fromJsonArray(String json) throws IOException { 38 | return NomadJson.deserializeList(json, SchedulerSetConfigurationResponse.class); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/SearchResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class SearchResponse extends ApiObject { 17 | private Map> matches; 18 | private Map truncations; 19 | 20 | @JsonProperty("Matches") 21 | public Map> getMatches() { 22 | return matches; 23 | } 24 | 25 | public SearchResponse setMatches(Map> matches) { 26 | this.matches = matches; 27 | return this; 28 | } 29 | 30 | public SearchResponse addMatches(String key, List value) { 31 | if (this.matches == null) 32 | this.matches = new java.util.HashMap<>(); 33 | this.matches.put(key, value); 34 | return this; 35 | } 36 | 37 | @JsonProperty("Truncations") 38 | public Map getTruncations() { 39 | return truncations; 40 | } 41 | 42 | public SearchResponse setTruncations(Map truncations) { 43 | this.truncations = truncations; 44 | return this; 45 | } 46 | 47 | public SearchResponse addTruncations(String key, boolean value) { 48 | if (this.truncations == null) 49 | this.truncations = new java.util.HashMap<>(); 50 | this.truncations.put(key, value); 51 | return this; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return NomadJson.serialize(this); 57 | } 58 | 59 | public static SearchResponse fromJson(String json) throws IOException { 60 | return NomadJson.deserialize(json, SearchResponse.class); 61 | } 62 | 63 | public static List fromJsonArray(String json) throws IOException { 64 | return NomadJson.deserializeList(json, SearchResponse.class); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/Spread.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class Spread extends ApiObject { 16 | private String attribute; 17 | private short weight; 18 | private List spreadTarget; 19 | 20 | @JsonProperty("Attribute") 21 | public String getAttribute() { 22 | return attribute; 23 | } 24 | 25 | public Spread setAttribute(String attribute) { 26 | this.attribute = attribute; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Weight") 31 | public short getWeight() { 32 | return weight; 33 | } 34 | 35 | public Spread setWeight(short weight) { 36 | this.weight = weight; 37 | return this; 38 | } 39 | 40 | @JsonProperty("SpreadTarget") 41 | public List getSpreadTarget() { 42 | return spreadTarget; 43 | } 44 | 45 | public Spread setSpreadTarget(List spreadTarget) { 46 | this.spreadTarget = spreadTarget; 47 | return this; 48 | } 49 | 50 | public Spread addSpreadTarget(SpreadTarget... spreadTarget) { 51 | if (this.spreadTarget == null) 52 | this.spreadTarget = new java.util.ArrayList<>(); 53 | for (SpreadTarget item : spreadTarget) 54 | this.spreadTarget.add(item); 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static Spread fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, Spread.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, Spread.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/SpreadTarget.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class SpreadTarget extends ApiObject { 16 | private String value; 17 | private byte percent; 18 | 19 | @JsonProperty("Value") 20 | public String getValue() { 21 | return value; 22 | } 23 | 24 | public SpreadTarget setValue(String value) { 25 | this.value = value; 26 | return this; 27 | } 28 | 29 | @JsonProperty("Percent") 30 | public byte getPercent() { 31 | return percent; 32 | } 33 | 34 | public SpreadTarget setPercent(byte percent) { 35 | this.percent = percent; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static SpreadTarget fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, SpreadTarget.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, SpreadTarget.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/StatObject.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class StatObject extends ApiObject { 17 | private Map nested; 18 | private Map attributes; 19 | 20 | @JsonProperty("Nested") 21 | public Map getNested() { 22 | return nested; 23 | } 24 | 25 | public StatObject setNested(Map nested) { 26 | this.nested = nested; 27 | return this; 28 | } 29 | 30 | public StatObject addNested(String key, StatObject value) { 31 | if (this.nested == null) 32 | this.nested = new java.util.HashMap<>(); 33 | this.nested.put(key, value); 34 | return this; 35 | } 36 | 37 | @JsonProperty("Attributes") 38 | public Map getAttributes() { 39 | return attributes; 40 | } 41 | 42 | public StatObject setAttributes(Map attributes) { 43 | this.attributes = attributes; 44 | return this; 45 | } 46 | 47 | public StatObject addAttributes(String key, StatValue value) { 48 | if (this.attributes == null) 49 | this.attributes = new java.util.HashMap<>(); 50 | this.attributes.put(key, value); 51 | return this; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return NomadJson.serialize(this); 57 | } 58 | 59 | public static StatObject fromJson(String json) throws IOException { 60 | return NomadJson.deserialize(json, StatObject.class); 61 | } 62 | 63 | public static List fromJsonArray(String json) throws IOException { 64 | return NomadJson.deserializeList(json, StatObject.class); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/StreamFrame.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class StreamFrame extends ApiObject { 16 | private long offset; 17 | private byte[] data; 18 | private String file; 19 | private String fileEvent; 20 | 21 | @JsonProperty("Offset") 22 | public long getOffset() { 23 | return offset; 24 | } 25 | 26 | public StreamFrame setOffset(long offset) { 27 | this.offset = offset; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Data") 32 | public byte[] getData() { 33 | return data; 34 | } 35 | 36 | public StreamFrame setData(byte[] data) { 37 | this.data = data; 38 | return this; 39 | } 40 | 41 | @JsonProperty("File") 42 | public String getFile() { 43 | return file; 44 | } 45 | 46 | public StreamFrame setFile(String file) { 47 | this.file = file; 48 | return this; 49 | } 50 | 51 | @JsonProperty("FileEvent") 52 | public String getFileEvent() { 53 | return fileEvent; 54 | } 55 | 56 | public StreamFrame setFileEvent(String fileEvent) { 57 | this.fileEvent = fileEvent; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static StreamFrame fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, StreamFrame.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, StreamFrame.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/TaskCsiPluginConfig.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class TaskCsiPluginConfig extends ApiObject { 16 | private String id; 17 | private String type; 18 | private String mountDir; 19 | 20 | @JsonProperty("ID") 21 | public String getId() { 22 | return id; 23 | } 24 | 25 | public TaskCsiPluginConfig setId(String id) { 26 | this.id = id; 27 | return this; 28 | } 29 | 30 | @JsonProperty("Type") 31 | public String getType() { 32 | return type; 33 | } 34 | 35 | public TaskCsiPluginConfig setType(String type) { 36 | this.type = type; 37 | return this; 38 | } 39 | 40 | @JsonProperty("MountDir") 41 | public String getMountDir() { 42 | return mountDir; 43 | } 44 | 45 | public TaskCsiPluginConfig setMountDir(String mountDir) { 46 | this.mountDir = mountDir; 47 | return this; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return NomadJson.serialize(this); 53 | } 54 | 55 | public static TaskCsiPluginConfig fromJson(String json) throws IOException { 56 | return NomadJson.deserialize(json, TaskCsiPluginConfig.class); 57 | } 58 | 59 | public static List fromJsonArray(String json) throws IOException { 60 | return NomadJson.deserializeList(json, TaskCsiPluginConfig.class); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/TaskLifecycle.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class TaskLifecycle extends ApiObject { 16 | private String hook; 17 | private boolean sidecar; 18 | 19 | @JsonProperty("Hook") 20 | public String getHook() { 21 | return hook; 22 | } 23 | 24 | public TaskLifecycle setHook(String hook) { 25 | this.hook = hook; 26 | return this; 27 | } 28 | 29 | @JsonProperty("Sidecar") 30 | public boolean getSidecar() { 31 | return sidecar; 32 | } 33 | 34 | public TaskLifecycle setSidecar(boolean sidecar) { 35 | this.sidecar = sidecar; 36 | return this; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return NomadJson.serialize(this); 42 | } 43 | 44 | public static TaskLifecycle fromJson(String json) throws IOException { 45 | return NomadJson.deserialize(json, TaskLifecycle.class); 46 | } 47 | 48 | public static List fromJsonArray(String json) throws IOException { 49 | return NomadJson.deserializeList(json, TaskLifecycle.class); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/TaskResourceUsage.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * This is a generated JavaBean representing a request or response structure. 13 | * 14 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 15 | */ 16 | public final class TaskResourceUsage extends ApiObject { 17 | private ResourceUsage resourceUsage; 18 | private long timestamp; 19 | private Map pids; 20 | 21 | @JsonProperty("ResourceUsage") 22 | public ResourceUsage getResourceUsage() { 23 | return resourceUsage; 24 | } 25 | 26 | public TaskResourceUsage setResourceUsage(ResourceUsage resourceUsage) { 27 | this.resourceUsage = resourceUsage; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Timestamp") 32 | public long getTimestamp() { 33 | return timestamp; 34 | } 35 | 36 | public TaskResourceUsage setTimestamp(long timestamp) { 37 | this.timestamp = timestamp; 38 | return this; 39 | } 40 | 41 | @JsonProperty("Pids") 42 | public Map getPids() { 43 | return pids; 44 | } 45 | 46 | public TaskResourceUsage setPids(Map pids) { 47 | this.pids = pids; 48 | return this; 49 | } 50 | 51 | public TaskResourceUsage addPids(String key, ResourceUsage value) { 52 | if (this.pids == null) 53 | this.pids = new java.util.HashMap<>(); 54 | this.pids.put(key, value); 55 | return this; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return NomadJson.serialize(this); 61 | } 62 | 63 | public static TaskResourceUsage fromJson(String json) throws IOException { 64 | return NomadJson.deserialize(json, TaskResourceUsage.class); 65 | } 66 | 67 | public static List fromJsonArray(String json) throws IOException { 68 | return NomadJson.deserializeList(json, TaskResourceUsage.class); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/VolumeMount.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.javasdk.ApiObject; 5 | import com.hashicorp.nomad.javasdk.NomadJson; 6 | 7 | import java.io.IOException; 8 | import java.util.List; 9 | 10 | /** 11 | * This is a generated JavaBean representing a request or response structure. 12 | * 13 | * @see Nomad HTTP API documentation associated with the endpoint you are using. 14 | */ 15 | public final class VolumeMount extends ApiObject { 16 | private String volume; 17 | private String destination; 18 | private Boolean readOnly; 19 | private String propagationMode; 20 | 21 | @JsonProperty("Volume") 22 | public String getVolume() { 23 | return volume; 24 | } 25 | 26 | public VolumeMount setVolume(String volume) { 27 | this.volume = volume; 28 | return this; 29 | } 30 | 31 | @JsonProperty("Destination") 32 | public String getDestination() { 33 | return destination; 34 | } 35 | 36 | public VolumeMount setDestination(String destination) { 37 | this.destination = destination; 38 | return this; 39 | } 40 | 41 | @JsonProperty("ReadOnly") 42 | public Boolean getReadOnly() { 43 | return readOnly; 44 | } 45 | 46 | public VolumeMount setReadOnly(Boolean readOnly) { 47 | this.readOnly = readOnly; 48 | return this; 49 | } 50 | 51 | @JsonProperty("PropagationMode") 52 | public String getPropagationMode() { 53 | return propagationMode; 54 | } 55 | 56 | public VolumeMount setPropagationMode(String propagationMode) { 57 | this.propagationMode = propagationMode; 58 | return this; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return NomadJson.serialize(this); 64 | } 65 | 66 | public static VolumeMount fromJson(String json) throws IOException { 67 | return NomadJson.deserialize(json, VolumeMount.class); 68 | } 69 | 70 | public static List fromJsonArray(String json) throws IOException { 71 | return NomadJson.deserializeList(json, VolumeMount.class); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/apimodel/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Object model for 3 | * Nomad HTTP API 4 | * responses. 5 | */ 6 | package com.hashicorp.nomad.apimodel; 7 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ApiObject.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 4 | import com.fasterxml.jackson.annotation.JsonAnySetter; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * Abstract parent class for API objects that allows them to preserve properties they don't explicitly model. 10 | */ 11 | public abstract class ApiObject { 12 | 13 | private Map unmappedProperties; 14 | 15 | /** 16 | * Gets all properties that aren't mapped to Java bean properties. 17 | *

18 | * The primary purpose of this method is to provide a mechanism for unknown properties to remain intact after 19 | * a round-trip from JSON to this class and back again. If you find yourself needing to read or write a property 20 | * that is not yet modelled as a bean property, consider looking for a newer version of the SDK. 21 | */ 22 | @JsonAnyGetter 23 | public Map getUnmappedProperties() { 24 | return unmappedProperties; 25 | } 26 | 27 | /** 28 | * Sets a property that isn't mapped to a Java bean property. 29 | *

30 | * The primary purpose of this method is to provide a mechanism for unknown properties to remain intact after 31 | * a round-trip from JSON to this class and back again. If you find yourself needing to read or write a property 32 | * that is not yet modelled as a bean property, consider looking for a newer version of the SDK. 33 | * 34 | * @param name name of the property 35 | * @param value value of the property 36 | */ 37 | @JsonAnySetter 38 | public void addUnmappedProperty(String name, Object value) { 39 | if (this.unmappedProperties == null) 40 | this.unmappedProperties = new java.util.HashMap<>(); 41 | unmappedProperties.put(name, value); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/CustomDateDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.fasterxml.jackson.core.JsonParser; 4 | import com.fasterxml.jackson.core.JsonTokenId; 5 | import com.fasterxml.jackson.databind.DeserializationContext; 6 | import com.fasterxml.jackson.databind.deser.std.StdDeserializer; 7 | import com.fasterxml.jackson.databind.util.ISO8601Utils; 8 | 9 | import java.io.IOException; 10 | import java.text.ParsePosition; 11 | import java.util.Date; 12 | 13 | /** 14 | * Custom deserializer to parse dates in iso8601 format. This is much much faster and GC friendly than using 15 | * SimpleDateFormat so highly suitable to (un)serialize lots of date objects. Also it help to fix date parsing 16 | * issue in iso8601 format. 17 | * 18 | * Supported parse format: [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]] 19 | * 20 | * 21 | * Fix: issue#32: Failed to deserialize timestamp with non-UTC time zone. 22 | * 23 | * @see this specification 24 | */ 25 | public class CustomDateDeserializer extends StdDeserializer { 26 | /** 27 | * Default constructor. 28 | */ 29 | public CustomDateDeserializer() { 30 | this(Date.class); 31 | } 32 | 33 | /** 34 | * Constructor with class parameter. 35 | * 36 | * @param vc class parameter 37 | */ 38 | public CustomDateDeserializer(Class vc) { 39 | super(vc); 40 | } 41 | 42 | @Override 43 | public Date deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { 44 | if (jp.getCurrentTokenId() == JsonTokenId.ID_STRING) { 45 | try { 46 | return ISO8601Utils.parse(jp.getText(), new ParsePosition(0)); 47 | } catch (Exception e) { 48 | throw new IOException(e); 49 | } 50 | } else { 51 | throw new IOException("Unparseable data which is expected as STRING: " + jp.getCurrentToken().toString()); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ErrorFoundInResponseEntityException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | /** 4 | * Indicates that the server sent an HTTP 200 status code 5 | * but signaled an error using a field in the response entity. 6 | */ 7 | class ErrorFoundInResponseEntityException extends Exception { 8 | ErrorFoundInResponseEntityException(String error) { 9 | super(error); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/EvaluationResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import org.apache.http.HttpResponse; 4 | 5 | /** 6 | * Response from a request to a Nomad API that results in a new evaluation. 7 | * 8 | * @see Nomad Glossary definition of "evaluation" 9 | */ 10 | public class EvaluationResponse extends ServerResponse { 11 | 12 | /** 13 | * Creates a new EvaluationResponse. 14 | * 15 | * @param httpResponse the underlying HTTP response 16 | * @param rawEntity the unparsed HTTP response entity (body) 17 | * @param evaluationId the evaluation ID parsed from the response 18 | */ 19 | public EvaluationResponse(HttpResponse httpResponse, String rawEntity, String evaluationId) { 20 | super(httpResponse, rawEntity, evaluationId); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/FileStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.hashicorp.nomad.javasdk; 19 | 20 | /** Allows a stream to be aborted before it finishes on its own. */ 21 | public class FileStream { 22 | 23 | private volatile boolean hasAborted; 24 | 25 | /** Aborts the stream. */ 26 | public void abort() { 27 | hasAborted = true; 28 | } 29 | 30 | boolean hasAborted() { 31 | return hasAborted; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/JobVersionsResponseData.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import com.hashicorp.nomad.apimodel.Job; 5 | import com.hashicorp.nomad.apimodel.JobDiff; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Represents a job versions API response. 11 | */ 12 | public class JobVersionsResponseData { 13 | private List versions; 14 | private List jobDifferences; 15 | 16 | /** 17 | * Gets the versions of the job. 18 | */ 19 | @JsonProperty("Versions") 20 | public List getVersions() { 21 | return versions; 22 | } 23 | 24 | /** 25 | * Sets the versions of the job. 26 | * 27 | * @param versions the versions of the job 28 | */ 29 | public JobVersionsResponseData setJobs(List versions) { 30 | this.versions = versions; 31 | return this; 32 | } 33 | 34 | /** 35 | * Gets the diffs between job versions. 36 | */ 37 | @JsonProperty("JobDiffs") 38 | public List getJobDiffs() { 39 | return jobDifferences; 40 | } 41 | 42 | /** 43 | * Sets the diffs between job versions. 44 | * 45 | * @param jobDifferences the diffs between job versions 46 | */ 47 | public JobVersionsResponseData setJobDifferences(List jobDifferences) { 48 | this.jobDifferences = jobDifferences; 49 | return this; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/JsonParser.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.fasterxml.jackson.databind.JavaType; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * Wraps a Jackson ObjectMapper to parse values of a specific type. 9 | * @param 10 | */ 11 | class JsonParser implements ValueExtractor { 12 | private final JavaType responseEntityType; 13 | 14 | JsonParser(JavaType responseEntityType) { 15 | this.responseEntityType = responseEntityType; 16 | } 17 | 18 | /** 19 | * Parses a value from the JSON string. 20 | */ 21 | @Override 22 | public T extractValue(String json) throws ResponseParsingException { 23 | try { 24 | return NomadJson.deserialize(json, responseEntityType); 25 | } catch (IOException e) { 26 | throw new ResponseParsingException( 27 | "Unable to parse " + responseEntityType + " from response body JSON: " + json, 28 | json, 29 | e); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/NomadException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * An error either signaled by the remote agent or arising while interpreting its response. 7 | */ 8 | public class NomadException extends Exception { 9 | NomadException(@Nullable String message, @Nullable Throwable cause) { 10 | super(message, cause); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/NomadHostnameVerifier.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import org.apache.http.conn.ssl.DefaultHostnameVerifier; 4 | 5 | import javax.net.ssl.HostnameVerifier; 6 | import javax.net.ssl.SSLException; 7 | import javax.net.ssl.SSLSession; 8 | import java.security.cert.CertificateParsingException; 9 | import java.security.cert.X509Certificate; 10 | import java.util.Collection; 11 | import java.util.List; 12 | import java.util.regex.Pattern; 13 | 14 | /** 15 | * A hostname verifier that accepts certificates of the form expected from Nomad, 16 | * i.e. with alternative names of the form {@code server.*.nomad} or {@code server.*.nomad}, 17 | * in addition to the usual HTTPS behaviour of accepting alt names matching the host being connected to. 18 | */ 19 | class NomadHostnameVerifier implements HostnameVerifier { 20 | 21 | private static final Pattern NOMAD_ALT_NAME_PATTERN = 22 | Pattern.compile("^(?:server|client)\\..+\\.nomad$"); 23 | 24 | private final DefaultHostnameVerifier defaultHostnameVerifier = new DefaultHostnameVerifier(); 25 | 26 | @Override 27 | public boolean verify(String host, SSLSession sslSession) { 28 | return hasNomadAgentAltName(sslSession) || defaultHostnameVerifier.verify(host, sslSession); 29 | } 30 | 31 | private boolean hasNomadAgentAltName(final SSLSession session) { 32 | try { 33 | final X509Certificate certificate = (X509Certificate) session.getPeerCertificates()[0]; 34 | final Collection> entries = certificate.getSubjectAlternativeNames(); 35 | if (entries == null) { 36 | return false; 37 | } 38 | for (List entry : entries) { 39 | if (entry.size() >= 2 && (Integer) entry.get(0) == 2) { 40 | final String name = (String) entry.get(1); 41 | if (NOMAD_ALT_NAME_PATTERN.matcher(name).matches()) { 42 | return true; 43 | } 44 | } 45 | } 46 | } catch (final SSLException | CertificateParsingException ignored) { 47 | } 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/NomadResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * Response from the Nomad API. 7 | * 8 | * @param type of value that was deserialized from the response body 9 | */ 10 | public class NomadResponse { 11 | private final String rawEntity; 12 | private final T value; 13 | 14 | /** 15 | * Creates a new NomadResponse. 16 | * 17 | * @param rawEntity the unparsed HTTP response entity (body) 18 | * @param value response value extracted from the response entity 19 | */ 20 | public NomadResponse(String rawEntity, @Nullable T value) { 21 | this.rawEntity = rawEntity; 22 | this.value = value; 23 | } 24 | 25 | /** 26 | * @return the raw HTTP response body as a String 27 | */ 28 | public String getRawEntity() { 29 | return rawEntity; 30 | } 31 | 32 | /** 33 | * @return the deserialised response value 34 | */ 35 | public T getValue() { 36 | return value; 37 | } 38 | 39 | @Override 40 | public String toString() { 41 | return ""; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/Predicate.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | /** 4 | * A predicate representing a boolean property. 5 | * 6 | * @param The type on which the predicate can be evaluated 7 | */ 8 | public interface Predicate { 9 | 10 | /** 11 | * Evaluates the predicate. 12 | * 13 | * @param value the value to check the predicate against 14 | * @return true if the value satisfies the predicate, false if it does not 15 | */ 16 | boolean apply(T value); 17 | } 18 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/RegionsApi.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | 4 | import java.io.IOException; 5 | import java.util.List; 6 | 7 | /** 8 | * API for querying for information about regions, 9 | * exposing the functionality of the {@code /v1/regions} endpoint of the 10 | * Nomad HTTP API. 11 | */ 12 | public class RegionsApi extends ApiBase { 13 | 14 | RegionsApi(NomadApiClient apiClient) { 15 | super(apiClient); 16 | } 17 | 18 | /** 19 | * List the names of the known regions in the cluster. 20 | * 21 | * @throws IOException if there is an HTTP or lower-level problem 22 | * @throws NomadException if the response signals an error or cannot be deserialized 23 | * @see {@code GET /v1/regions} 24 | */ 25 | public NomadResponse> list() throws IOException, NomadException { 26 | return executePlain(get("/v1/regions"), NomadJson.parserForListOf(String.class)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/RequestOptions.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * Interface for options shared by all API requests. 7 | */ 8 | public interface RequestOptions { 9 | 10 | /** 11 | * Gets the region to which requests should be forwarded. 12 | * 13 | * @return the region the request should be routed to, 14 | * or null if the API client's default region configuration should be used. 15 | * @see Cross-Region Requests 16 | */ 17 | @Nullable 18 | String getRegion(); 19 | 20 | /** 21 | * Gets the namespace for this request. 22 | *

23 | * When null, falls back to the NomadApiClient's namespace. 24 | */ 25 | @Nullable 26 | String getNamespace(); 27 | 28 | /** 29 | * Gets the secret ID of the ACL token to use for this request. 30 | *

31 | * When null, falls back to the NomadApiClient's auth token. 32 | */ 33 | @Nullable 34 | String getAuthToken(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/RequestSerializationException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | /** 4 | * Indicates that there was a problem serialising the request entity. 5 | */ 6 | public class RequestSerializationException extends RuntimeException { 7 | RequestSerializationException(String message, Throwable cause) { 8 | super(message, cause); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ResponseAdapter.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import org.apache.http.HttpResponse; 4 | import org.apache.http.util.EntityUtils; 5 | 6 | import javax.annotation.Nullable; 7 | import java.io.IOException; 8 | 9 | /** 10 | * Creates a specific type of {@link NomadResponse} 11 | * from an async-http-client response. 12 | * 13 | * This abstract class is used by package-private methods that allow endpoint implementations to be 14 | * consistent and concise. 15 | * 16 | * @param type extracted from response bodies 17 | * @param type of response created 18 | */ 19 | abstract class ResponseAdapter> { 20 | private final ValueExtractor valueExtractor; 21 | 22 | protected ResponseAdapter(@Nullable ValueExtractor valueExtractor) { 23 | this.valueExtractor = valueExtractor; 24 | } 25 | 26 | public R apply(HttpResponse httpResponse) 27 | throws IOException, ResponseParsingException, ErrorFoundInResponseEntityException { 28 | 29 | String rawEntity = EntityUtils.toString(httpResponse.getEntity()); 30 | T value = valueExtractor == null 31 | ? null 32 | : valueExtractor.extractValue(rawEntity); 33 | return buildResponse(httpResponse, rawEntity, value); 34 | } 35 | 36 | protected abstract R buildResponse(HttpResponse httpResponse, String rawEntity, @Nullable T value); 37 | } 38 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ResponseException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * An exception that includes the raw response entity. 7 | */ 8 | public abstract class ResponseException extends NomadException { 9 | private final String rawEntity; 10 | 11 | ResponseException(String message, @Nullable String rawEntity, @Nullable Throwable cause) { 12 | super(message, cause); 13 | this.rawEntity = rawEntity; 14 | } 15 | 16 | /** 17 | * @return raw string representation of the response entity, 18 | * or null for streaming response or if there was a problem receiving the entity. 19 | */ 20 | public String getRawEntity() { 21 | return rawEntity; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ResponseHeaderException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * Thrown when there is a problem with a response header. 7 | */ 8 | public class ResponseHeaderException extends RuntimeException { 9 | ResponseHeaderException(String message, @Nullable Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | static ResponseHeaderException parsing(String name, String value, Throwable cause) { 14 | return new ResponseHeaderException( 15 | "Error parsing " + name + " header with value \"" + value + "\":" + cause, 16 | cause); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ResponseParsingException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * Indicates a problem with parsing the response entity. 7 | */ 8 | public class ResponseParsingException extends ResponseException { 9 | ResponseParsingException(String message, @Nullable String rawEntity, @Nullable Throwable cause) { 10 | super(message, rawEntity, cause); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/RetryInterruptedException.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | /** 4 | * Indicates that Nomad was interrupted while waiting to retry a request. 5 | */ 6 | public class RetryInterruptedException extends NomadException { 7 | RetryInterruptedException(InterruptedException e) { 8 | super(null, e); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ServerQueryResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import org.apache.http.HttpResponse; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | /** 8 | * A response from a query request to a Nomad server API. 9 | * 10 | * @param type of value that was deserialized from the response body 11 | */ 12 | public class ServerQueryResponse extends ServerResponse { 13 | public static final String X_NOMAD_LASTCONTACT = "X-Nomad-LastContact"; 14 | public static final String X_NOMAD_KNOWNLEADER = "X-Nomad-KnownLeader"; 15 | 16 | /** 17 | * Creates a new ServerQueryResponse. 18 | * 19 | * @param httpResponse the underlying HTTP response 20 | * @param rawEntity the unparsed HTTP response entity (body) 21 | * @param value response value extracted from the response entity 22 | */ 23 | public ServerQueryResponse(HttpResponse httpResponse, String rawEntity, @Nullable T value) { 24 | super(httpResponse, rawEntity, value); 25 | } 26 | 27 | /** 28 | * Indicates whether the server had a known leader when responding to the request. 29 | * 30 | * @return true if the @{code X-Nomad-KnownLeader} header was "true", otherwise false 31 | * @throws ResponseHeaderException if the header is missing 32 | */ 33 | public boolean hadKnownLeader() throws ResponseHeaderException { 34 | return "true".equals(httpResponse.getFirstHeader(X_NOMAD_KNOWNLEADER).getValue()); 35 | } 36 | 37 | /** 38 | * Milliseconds that had elapsed on the server since it last had contact with the leader. 39 | *

40 | * This can be used to gauge staleness when using {@link QueryOptions#setAllowStale(boolean)}. 41 | * 42 | * @throws ResponseHeaderException if the header is missing or cannot be parsed 43 | */ 44 | public long getMillisSinceLastContact() throws ResponseHeaderException { 45 | String stringValue = httpResponse.getFirstHeader(X_NOMAD_LASTCONTACT).getValue(); 46 | try { 47 | return Long.parseLong(stringValue); 48 | } catch (NumberFormatException e) { 49 | throw ResponseHeaderException.parsing(X_NOMAD_LASTCONTACT, stringValue, e); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ServerResponse.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import org.apache.http.HttpResponse; 4 | 5 | import javax.annotation.Nullable; 6 | import java.math.BigInteger; 7 | 8 | /** 9 | * A response from a Nomad server API. 10 | *

11 | * The index in a ServerResponse can be used with {@link QueryOptions} in subsequent requests to perform 12 | * Blocking Queries. 13 | * 14 | * @param type of value that was extracted from the response body 15 | */ 16 | public class ServerResponse extends NomadResponse { 17 | public static final String X_NOMAD_INDEX = "X-Nomad-Index"; 18 | 19 | protected final HttpResponse httpResponse; 20 | 21 | /** 22 | * Creates a new ServerResponse. 23 | * 24 | * @param httpResponse the underlying HTTP response 25 | * @param rawEntity the unparsed HTTP response entity (body) 26 | * @param value response value extracted from the response entity 27 | */ 28 | public ServerResponse(HttpResponse httpResponse, String rawEntity, @Nullable T value) { 29 | super(rawEntity, value); 30 | this.httpResponse = httpResponse; 31 | } 32 | 33 | /** 34 | * Returns the raw HttpResponse. 35 | */ 36 | public HttpResponse getHttpResponse() { 37 | return httpResponse; 38 | } 39 | 40 | /** 41 | * Returns the value of the @{code X-Nomad-Index} header. 42 | * 43 | * @throws ResponseHeaderException if the header is missing or cannot be parsed 44 | * @see Blocking Queries 45 | */ 46 | public BigInteger getIndex() throws ResponseHeaderException { 47 | String stringValue = httpResponse.getFirstHeader(X_NOMAD_INDEX).getValue(); 48 | try { 49 | return new BigInteger(stringValue); 50 | } catch (NumberFormatException e) { 51 | throw ResponseHeaderException.parsing(X_NOMAD_INDEX, stringValue, e); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/ValueExtractor.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | /** 4 | * A method that extracts a strongly typed value from a string. 5 | * 6 | * This interface is used by package-private methods that allow endpoint implementations to be consistent and concise. 7 | * 8 | * @param type extracted from the string 9 | */ 10 | interface ValueExtractor { 11 | T extractValue(String string) throws ResponseParsingException, ErrorFoundInResponseEntityException; 12 | 13 | ValueExtractor RAW_STRING = new ValueExtractor() { 14 | @Override 15 | public String extractValue(String string) { 16 | return string; 17 | } 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/WaitStrategyExhaustedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.hashicorp.nomad.javasdk; 19 | 20 | import javax.annotation.Nullable; 21 | 22 | /** 23 | * Indicates that a WaitStrategy determined that a request should not be remade. 24 | */ 25 | public class WaitStrategyExhaustedException extends NomadException { 26 | 27 | /** 28 | * Creates a new WaitStrategy. 29 | * 30 | * @param message the exception message 31 | */ 32 | public WaitStrategyExhaustedException(String message) { 33 | this(message, null); 34 | } 35 | 36 | /** 37 | * Creates a new WaitStrategy. 38 | * 39 | * @param message the exception message 40 | * @param cause the underlying exception that caused this exception 41 | */ 42 | public WaitStrategyExhaustedException(String message, @Nullable Throwable cause) { 43 | super(message, cause); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sdk/src/main/java/com/hashicorp/nomad/javasdk/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * The Nomad Java SDK. 3 | * 4 | * The central class in this package is {@link com.hashicorp.nomad.javasdk.NomadApiClient}, 5 | * a client for interacting with the Nomad HTTP API. 6 | */ 7 | @ParametersAreNonnullByDefault 8 | package com.hashicorp.nomad.javasdk; 9 | 10 | import javax.annotation.ParametersAreNonnullByDefault; 11 | -------------------------------------------------------------------------------- /sdk/src/test/java/com/hashicorp/nomad/apimodel/ConstraintTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import com.hashicorp.nomad.javasdk.NomadJson; 4 | import org.junit.Test; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | import static org.junit.Assert.assertEquals; 10 | 11 | public class ConstraintTest { 12 | 13 | @Test 14 | public void shouldWorkAfterJsonRoundtrip() throws Exception { 15 | 16 | final Constraint constraint = new Constraint() 17 | .setLTarget("foo") 18 | .setOperand("bar") 19 | .setRTarget("baz"); 20 | 21 | final Constraint deserialized = Constraint.fromJson(constraint.toString()); 22 | assertEquals("foo", deserialized.getLTarget()); 23 | assertEquals("bar", deserialized.getOperand()); 24 | assertEquals("baz", deserialized.getRTarget()); 25 | } 26 | 27 | @Test 28 | public void shouldHaveCorrectJsonRepresentation() throws Exception { 29 | 30 | final Constraint constraint = new Constraint() 31 | .setLTarget("foo") 32 | .setOperand("bar") 33 | .setRTarget("baz"); 34 | 35 | final Map expected = new HashMap<>(); 36 | expected.put("LTarget", "foo"); 37 | expected.put("Operand", "bar"); 38 | expected.put("RTarget", "baz"); 39 | 40 | assertEquals(expected, NomadJson.deserialize(constraint.toString(), Map.class)); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /sdk/src/test/java/com/hashicorp/nomad/apimodel/TaskArtifactTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.apimodel; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | public class TaskArtifactTest { 8 | 9 | @Test 10 | public void shouldWorkAfterJsonRoundtrip() throws Exception { 11 | 12 | final TaskArtifact artifact = new TaskArtifact() 13 | .setGetterSource("foo") 14 | .setRelativeDest("bar"); 15 | 16 | final TaskArtifact deserialized = TaskArtifact.fromJson(artifact.toString()); 17 | assertEquals("foo", deserialized.getGetterSource()); 18 | assertEquals("bar", deserialized.getRelativeDest()); 19 | assertEquals(null, deserialized.getGetterOptions()); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /sdk/src/test/java/com/hashicorp/nomad/javasdk/NomadJsonTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.apimodel.Job; 4 | import com.hashicorp.nomad.apimodel.UpdateStrategy; 5 | import org.apache.commons.io.IOUtils; 6 | import org.junit.Test; 7 | 8 | import java.util.HashMap; 9 | 10 | import static java.nio.charset.StandardCharsets.UTF_8; 11 | import static org.hamcrest.core.Is.is; 12 | import static org.junit.Assert.assertThat; 13 | 14 | public class NomadJsonTest { 15 | 16 | @Test 17 | public void shouldReadJsonJobSpec() throws Exception { 18 | String jobSpec = IOUtils.toString(getClass().getResourceAsStream("job.json"), UTF_8); 19 | final Job job = NomadJson.readJobSpec(jobSpec); 20 | assertThat(job.getId(), is("Job-ID")); 21 | } 22 | 23 | @Test 24 | public void shouldPreserveJobInWritingAndReadingJobSpec() throws Exception { 25 | final Job job = new Job().setName("Alice"); 26 | final Job afterRoundtrip = NomadJson.readJobSpec(NomadJson.asJobSpec(job)); 27 | assertThat(job.getName(), is("Alice")); 28 | } 29 | 30 | @Test 31 | public void shouldPreserveUnknownKeysInDeserialisation() throws Exception { 32 | String jobSpec = IOUtils.toString(getClass().getResourceAsStream("job.json"), UTF_8); 33 | final Job job = NomadJson.readJobSpec(jobSpec); 34 | assertThat(job.getId(), is("Job-ID")); 35 | 36 | assertThat(job.getUnmappedProperties().get("Unknown Job String"), is((Object) "Hi")); 37 | 38 | final HashMap expectedJobObject = new HashMap<>(); 39 | expectedJobObject.put("Foo", "Bar"); 40 | assertThat(job.getUnmappedProperties().get("Unknown Job Object"), is((Object) expectedJobObject)); 41 | 42 | final UpdateStrategy update = job.getUpdate(); 43 | 44 | assertThat(update.getUnmappedProperties().get("Unknown Update String"), is((Object) "here too")); 45 | 46 | final HashMap expectedUpdateObject = new HashMap<>(); 47 | expectedUpdateObject.put("anything", "goes"); 48 | assertThat(update.getUnmappedProperties().get("Unknown Update Object"), is((Object) expectedUpdateObject)); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /sdk/src/test/resources/com/hashicorp/nomad/javasdk/job.json: -------------------------------------------------------------------------------- 1 | { 2 | "Job": { 3 | "ID": "Job-ID", 4 | "Priority": 7, 5 | "AllAtOnce": true, 6 | "JobModifyIndex": 13, 7 | 8 | "Unknown Job String": "Hi", 9 | "Unknown Job Object": { 10 | "Foo": "Bar" 11 | }, 12 | 13 | "Update": { 14 | "Stagger": 42, 15 | 16 | "Unknown Update String": "here too", 17 | "Unknown Update Object": { 18 | "anything": "goes" 19 | } 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /testkit/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /testkit/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | 6 | nomad-testkit 7 | 0.12.0-SNAPSHOT 8 | 9 | 10 | 11 | org.apache.maven.plugins 12 | maven-compiler-plugin 13 | 14 | 8 15 | 8 16 | 17 | 18 | 19 | 20 | jar 21 | 22 | com.hashicorp.nomad 23 | nomad-sdk-parent 24 | 0.12.0-SNAPSHOT 25 | .. 26 | 27 | 28 | nomad-testkit 29 | 30 | 31 | 1.7 32 | UTF-8 33 | 34 | 35 | 36 | 37 | 38 | com.hashicorp.nomad 39 | nomad-sdk 40 | ${project.version} 41 | 42 | 43 | 44 | commons-io 45 | commons-io 46 | 47 | 48 | 49 | org.apache.commons 50 | commons-lang3 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /testkit/src/main/java/com/hashicorp/nomad/testutils/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Utilities for testing with a Nomad agent. 3 | * 4 | * These were written to test the Nomad Java and Scala SDKs, 5 | * but you might find {@link com.hashicorp.nomad.testutils.NomadAgentProcess} or 6 | * {@link com.hashicorp.nomad.testutils.TestAgent} useful in your own tests. 7 | */ 8 | package com.hashicorp.nomad.testutils; 9 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/HangTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad;/* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import com.hashicorp.nomad.javasdk.NomadApiClient; 19 | import org.apache.http.HttpHost; 20 | 21 | import java.io.Console; 22 | import java.net.URI; 23 | import java.net.URISyntaxException; 24 | 25 | import static java.sql.DriverManager.println; 26 | 27 | public class HangTest { 28 | 29 | public static void main(String[] args) throws URISyntaxException { 30 | new NomadApiClient(new HttpHost("localhost", 4646)); 31 | System.err.println("Hello"); 32 | // System.out.flush(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/ApiTestRunner.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import org.junit.runners.BlockJUnit4ClassRunner; 4 | import org.junit.runners.model.FrameworkMethod; 5 | import org.junit.runners.model.InitializationError; 6 | 7 | public class ApiTestRunner extends BlockJUnit4ClassRunner { 8 | 9 | /** 10 | * Creates a BlockJUnit4ClassRunner to run {@code klass} 11 | * 12 | * @param klass 13 | * @throws InitializationError if the test class is malformed. 14 | */ 15 | public ApiTestRunner(Class klass) throws InitializationError { 16 | super(klass); 17 | } 18 | 19 | @Override 20 | protected boolean isIgnored(FrameworkMethod child) { 21 | return super.isIgnored(child) || ( 22 | System.getProperty("NomadEnterprise") == null && 23 | child.getAnnotation(RequiresNomadEnterprise.class) != null 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/CsiPluginTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.apimodel.CsiPluginListStub; 4 | import com.hashicorp.nomad.apimodel.CsiVolumeListStub; 5 | import com.hashicorp.nomad.testutils.TestAgent; 6 | import org.junit.Test; 7 | 8 | import java.util.List; 9 | 10 | import static org.hamcrest.MatcherAssert.assertThat; 11 | import static org.hamcrest.Matchers.empty; 12 | 13 | public class CsiPluginTest extends ApiTestBase { 14 | 15 | // TODO: need some tests against actual CSI plugins, which will require configuring a client with CSI plugins 16 | 17 | @Test 18 | public void shouldListPlugins() throws Exception { 19 | try (TestAgent agent = newServer()) { 20 | CSIPluginsApi pluginsApi = agent.getApiClient().getCSIPluginsApi(); 21 | 22 | ServerQueryResponse> list = pluginsApi.list(); 23 | assertThat(list.getValue(), empty()); 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/CsiVolumeTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.apimodel.*; 4 | import com.hashicorp.nomad.testutils.TestAgent; 5 | import org.hamcrest.Matchers; 6 | import org.junit.Test; 7 | 8 | import java.io.IOException; 9 | import java.math.BigInteger; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | import static org.hamcrest.MatcherAssert.assertThat; 15 | import static org.hamcrest.Matchers.*; 16 | 17 | public class CsiVolumeTest extends ApiTestBase { 18 | 19 | // TODO: need some tests against actual CSI volumes, which will require configuring a client with CSI volumes 20 | 21 | @Test 22 | public void shouldListVolumes() throws Exception { 23 | try (TestAgent agent = newServer()) { 24 | CSIVolumesApi volumesApi = agent.getApiClient().getCSIVolumesApi(); 25 | 26 | ServerQueryResponse> list = volumesApi.list(); 27 | assertThat(list.getValue(), empty()); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/ErrorResponseAssertion.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk;/* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import java.io.IOException; 19 | 20 | import static org.hamcrest.MatcherAssert.assertThat; 21 | import static org.hamcrest.Matchers.containsString; 22 | import static org.hamcrest.Matchers.is; 23 | import static org.junit.Assert.fail; 24 | 25 | public abstract class ErrorResponseAssertion { 26 | 27 | public ErrorResponseAssertion(String partOfErrorMessage) throws IOException, NomadException { 28 | try { 29 | NomadResponse response = performRequest(); 30 | fail("Expected request to throw a ResponseException, but got " + response); 31 | } catch (ErrorResponseException e) { 32 | assertThat(e.getServerErrorMessage(), containsString(partOfErrorMessage)); 33 | } 34 | 35 | } 36 | 37 | public ErrorResponseAssertion(int code) throws IOException, NomadException { 38 | try { 39 | NomadResponse response = performRequest(); 40 | fail("Expected request to throw a ResponseException, but got " + response); 41 | } catch (ErrorResponseException e) { 42 | assertThat(e.getServerErrorCode(), is(code)); 43 | } 44 | } 45 | 46 | protected abstract NomadResponse performRequest() throws IOException, NomadException; 47 | } 48 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/NomadApiClientTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.apimodel.AclToken; 4 | import com.hashicorp.nomad.testutils.TestAgent; 5 | import org.junit.Test; 6 | 7 | import java.io.IOException; 8 | import java.util.UUID; 9 | 10 | import static org.hamcrest.MatcherAssert.assertThat; 11 | import static org.hamcrest.Matchers.is; 12 | 13 | public class NomadApiClientTest extends ApiTestBase { 14 | 15 | @Test 16 | public void shouldAllowRequestLevelTokenOverride() throws Exception { 17 | try (TestAgent agent = newAclBootstrappedServer()) { 18 | final AclTokensApi tokensApi = agent.getApiClient().getAclTokensApi(); 19 | final AclToken origSelfToken = tokensApi.self().getValue(); 20 | agent.getApiClient().setAuthToken(UUID.randomUUID().toString()); 21 | 22 | new ErrorResponseAssertion(403) { 23 | @Override 24 | protected NomadResponse performRequest() throws IOException, NomadException { 25 | return tokensApi.info(origSelfToken.getAccessorId()); 26 | } 27 | }; 28 | 29 | ServerQueryResponse qrySelfToken = tokensApi.self(new QueryOptions().setAuthToken(origSelfToken.getSecretId())); 30 | assertThat(qrySelfToken.getValue().getAccessorId(), is(origSelfToken.getAccessorId())); 31 | } 32 | } 33 | 34 | @Test 35 | public void shouldPreferRequestLevelToken() throws Exception { 36 | try (TestAgent agent = newAclBootstrappedServer()) { 37 | final AclTokensApi tokensApi = agent.getApiClient().getAclTokensApi(); 38 | final AclToken origSelfToken = tokensApi.self().getValue(); 39 | 40 | new ErrorResponseAssertion(403) { 41 | @Override 42 | protected NomadResponse performRequest() throws IOException, NomadException { 43 | return tokensApi.info(origSelfToken.getAccessorId(), new QueryOptions().setAuthToken(UUID.randomUUID().toString())); 44 | } 45 | }; 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/RegionsApiTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.testutils.NomadAgentConfiguration; 4 | import com.hashicorp.nomad.testutils.TestAgent; 5 | import org.junit.Test; 6 | 7 | import java.util.List; 8 | 9 | import static org.hamcrest.MatcherAssert.assertThat; 10 | import static org.hamcrest.Matchers.contains; 11 | 12 | public class RegionsApiTest extends ApiTestBase { 13 | 14 | @Test 15 | @SuppressWarnings("try") 16 | public void shouldListRegions() throws Exception { 17 | try (TestAgent globalAgent = newAgent(new NomadAgentConfiguration.Builder().setServerBootstrapExpect(2))) { 18 | try (TestAgent fooAgent = newAgent(new NomadAgentConfiguration.Builder().setRegion("foo").setServerStartJoin(globalAgent.getSerfAddress()))) { 19 | RegionsApi regionsApi = globalAgent.getApiClient().getRegionsApi(); 20 | 21 | NomadResponse> regionsResponse = regionsApi.list(); 22 | 23 | assertThat(regionsResponse.getValue(), contains("foo", "global")); 24 | } 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/RequiresNomadEnterprise.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Marks a test method that should be ignored when not testing against NomadEnterprise. 10 | * 11 | * By default, such methods will be ignored by {@link ApiTestRunner}, 12 | * but they will be run if the "NomadEnterprise" system property is set 13 | * (e.g. by passing `-DNomadEnterprise` on the java command line). 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target({ElementType.METHOD}) 17 | public @interface RequiresNomadEnterprise {} 18 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/SearchApiTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.apimodel.Job; 4 | import com.hashicorp.nomad.apimodel.JobListStub; 5 | import com.hashicorp.nomad.apimodel.SearchResponse; 6 | import com.hashicorp.nomad.testutils.TestAgent; 7 | import org.junit.Test; 8 | 9 | import java.util.List; 10 | import java.util.Map; 11 | 12 | import static org.hamcrest.MatcherAssert.assertThat; 13 | import static org.hamcrest.Matchers.hasSize; 14 | import static org.hamcrest.Matchers.is; 15 | import static org.junit.Assert.*; 16 | 17 | public class SearchApiTest extends ApiTestBase { 18 | 19 | @Test 20 | public void shouldListAssets() throws Exception { 21 | try (TestAgent agent = newServer()) { 22 | SearchApi searchApi = agent.getApiClient().getSearchApi(); 23 | 24 | Job job = createTestJob(); 25 | agent.getApiClient().getJobsApi().register(job); 26 | 27 | String jobId = job.getId(); 28 | ServerQueryResponse response = 29 | searchApi.prefixSearch(jobId.substring(0, jobId.length() - 2), "jobs", null); 30 | assertUpdatedServerQueryResponse(response); 31 | 32 | final List jobMatches = response.getValue().getMatches().get("jobs"); 33 | assertThat(jobMatches, hasSize(1)); 34 | assertThat(jobMatches.get(0), is(jobId)); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/javasdk/SystemApiTest.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.javasdk; 2 | 3 | import com.hashicorp.nomad.testutils.TestAgent; 4 | import org.junit.Test; 5 | 6 | import java.io.IOException; 7 | 8 | import static org.hamcrest.MatcherAssert.assertThat; 9 | import static org.hamcrest.Matchers.emptyOrNullString; 10 | 11 | public class SystemApiTest extends ApiTestBase { 12 | 13 | @Test 14 | public void shouldTriggerGarbageCollection() throws Exception { 15 | try (TestAgent agent = newServer()) { 16 | final SystemApi systemApi = agent.getApiClient().getSystemApi(); 17 | 18 | NomadResponse response = systemApi.garbageCollect(); 19 | assertThat(response.getRawEntity(), emptyOrNullString()); 20 | 21 | NomadResponse regionSpecificResponse = systemApi.garbageCollect(new WriteOptions("test-region")); 22 | assertThat(regionSpecificResponse.getRawEntity(), emptyOrNullString()); 23 | 24 | new ErrorResponseAssertion("No path to region") { 25 | @Override 26 | protected NomadResponse performRequest() throws IOException, NomadException { 27 | return systemApi.garbageCollect(new WriteOptions("non-existent-region")); 28 | } 29 | }; 30 | } 31 | } 32 | 33 | @Test 34 | public void shouldTriggerReconcilingSummaries() throws Exception { 35 | try (TestAgent agent = newServer()) { 36 | final SystemApi systemApi = agent.getApiClient().getSystemApi(); 37 | 38 | NomadResponse response = systemApi.reconcileSummaries(); 39 | assertThat(response.getRawEntity(), emptyOrNullString()); 40 | 41 | NomadResponse regionSpecificResponse = systemApi.reconcileSummaries(new WriteOptions("test-region")); 42 | assertThat(regionSpecificResponse.getRawEntity(), emptyOrNullString()); 43 | 44 | new ErrorResponseAssertion("No path to region") { 45 | @Override 46 | protected NomadResponse performRequest() throws IOException, NomadException { 47 | return systemApi.reconcileSummaries(new WriteOptions("non-existent-region")); 48 | } 49 | }; 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /testkit/src/test/java/com/hashicorp/nomad/testutils/TestMethodLogRule.java: -------------------------------------------------------------------------------- 1 | package com.hashicorp.nomad.testutils; 2 | 3 | import org.junit.rules.TestRule; 4 | import org.junit.runner.Description; 5 | import org.junit.runners.model.Statement; 6 | 7 | import java.io.PrintWriter; 8 | import java.io.StringWriter; 9 | 10 | public class TestMethodLogRule extends PrintWriter implements TestRule { 11 | 12 | private final StringWriter stringWriter; 13 | 14 | public TestMethodLogRule() { 15 | this(new StringWriter()); 16 | } 17 | 18 | public TestMethodLogRule(StringWriter stringWriter) { 19 | super(stringWriter); 20 | this.stringWriter = stringWriter; 21 | } 22 | 23 | @Override 24 | public Statement apply(final Statement base, final Description description) { 25 | return new Statement() { 26 | @Override 27 | public void evaluate() throws Throwable { 28 | stringWriter.getBuffer().delete(0, Integer.MAX_VALUE); 29 | try { 30 | base.evaluate(); 31 | } catch (Throwable t) { 32 | System.err.println(description + " has failed with " + t + "\nLog follows:\n"); 33 | System.err.print(stringWriter.getBuffer()); 34 | System.err.flush(); 35 | throw t; 36 | } 37 | } 38 | }; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/cfssl.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "expiry": "87600h", 5 | "usages": [ 6 | "signing", 7 | "key encipherment", 8 | "server auth", 9 | "client auth" 10 | ] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/client-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEA78u5UYcrhSN3k0KSdRwr9VyumznU2Dk4w/n4slJQMsu+LhoP 3 | k4wNGosQRS1bswU0jROxIP5uJLSPF2byv1b2637dG9CQkgXf7snyr1Y8HFmiAEoR 4 | MaKs7Ph161RSFweAUatraF8E4Pg9yqxXD0Hu8+mL/lwJ3S6AMuLar7UnXC1djvbv 5 | +ZFrhPlugV42DCpFQjfLoQjcnRSRhyaoCIJErR88HcYnMuvXyXAsv+/glRy37ZW6 6 | PHKpKMM+83U10AO4LWvJqTR8VRlnuD1hmGrPADWgPBDZyFXJVGl8SwWuFc3viWEs 7 | kmhslluc7J3n44YrGBMlZLHtlKcfn6vVukTOpwIDAQABAoIBAQDgoSboiIbsIV1S 8 | RXqM2ecT4c5u+q24H2JdszyVTyZxbwqohSEyRm+//aUwKF1ORgIEZf33ul/TYpDo 9 | ize6peyIjj7yX14ObBJpziPYvB9zL0PioX+Zz5nOIrHT0RlVGWHLH5luHBSl6eV4 10 | hhjH4ivFsXHCxNU4rObKxFe3YSuN2+EDw53PR8ZbML70vO13/wM5cId630ZKa1TH 11 | wCWZPLbIzpehTn5AhPFMLQmyUWNXr4VgNRK9yt2GwQP+OL62fn20VgTsO5coJOJy 12 | gkzPjfKCCh1jocDdrHvzD4pmUyAdxCpwOL4FFgDOQ4ogNpY22F7Yz1ckJMeRXmIy 13 | O+yAFnUBAoGBAPHhdDjKvmQdL4300er7e+UqNWdb6ytJqprcJdDtc2uyUgcCMZQe 14 | 2HtC+x2E4ob0ygNoPCUVXdOEr/T0IYNFrk08Y7v5xOr24iaRnAn1O7q6xJJp1QXM 15 | V6r/4+nbigkXZ+oDmzrBg/nr2z17HxOOQmvP7surxhae7TaoZDG3O8+5AoGBAP3L 16 | HUvjE0FwO3T5t5Wi4G80JiYsiQnSPVT+2SdUSwcgRm8FIyeIJytZS6ta9teexs7g 17 | PnuFTF007YxRq+mWJ5B+DzhxUYe+tSznfpWtnSgWOAMFrW5w1AummsyW/acO7UsG 18 | deOuP6DAO9FRES8DvXw5eK7oYBTqfh14lrUs2wFfAoGAFhIYZMY7MS9ok29vaB2i 19 | ZHrBfLjqcHy8UH0eBj5kdcNDsNgGZhmab0ThXQQvF1lmxYDRXCDi+tX0qElOdYf6 20 | K5oDD7fuu/HjGNnYfyAdXyCDp0h445qNtVC8Hy6lHcdA+B10IJxfyoI28xk08Lfe 21 | X7ANfhAidxXxVzduTQsHLiECgYBWXmwu6i0gZPBnA6CddNuKHKYq8ZcFV531sfD2 22 | uHH8D9jIaWgoSOaDkxT0ULWWdXtU5e19ncR6J8v7p8Oob6gxPSUy4SWM27LOgE2M 23 | 5JOKE92l8aWu4wjWmjEuFOhnlOXeVWmDPUZ8D0+MEVmWtWAjyW8vnvcrxw16PBKV 24 | v5kcYwKBgQDR3q5TdCeMW1+YYD2QAP9G5FkfMs7zjYDN9EX/ppYjyb0f28PDzCQa 25 | wVOsGJv/34UcGVMCImeXZ5Ig5sw3dxKdzC/W0gldhKnYMYGWoi1tLrsCg/Po6Dqk 26 | m/uskf/mtVa5UGnaITaAuuMaqaBRoYNszYtdkxvVxlanzvq/kuVoKw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/client.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIChzCCAW8CAQAwADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO/L 3 | uVGHK4Ujd5NCknUcK/Vcrps51Ng5OMP5+LJSUDLLvi4aD5OMDRqLEEUtW7MFNI0T 4 | sSD+biS0jxdm8r9W9ut+3RvQkJIF3+7J8q9WPBxZogBKETGirOz4detUUhcHgFGr 5 | a2hfBOD4PcqsVw9B7vPpi/5cCd0ugDLi2q+1J1wtXY727/mRa4T5boFeNgwqRUI3 6 | y6EI3J0UkYcmqAiCRK0fPB3GJzLr18lwLL/v4JUct+2VujxyqSjDPvN1NdADuC1r 7 | yak0fFUZZ7g9YZhqzwA1oDwQ2chVyVRpfEsFrhXN74lhLJJobJZbnOyd5+OGKxgT 8 | JWSx7ZSnH5+r1bpEzqcCAwEAAaBCMEAGCSqGSIb3DQEJDjEzMDEwLwYDVR0RBCgw 9 | JoITY2xpZW50Lmdsb2JhbC5ub21hZIIJbG9jYWxob3N0hwR/AAABMA0GCSqGSIb3 10 | DQEBCwUAA4IBAQDI5TxJ8cialtI5Z9k/sJXPsJyhy6dO/BUe/Sb2hRL+YH0hy+0t 11 | gvwZT+rODbRK+Hmkrvt2rekDIJ7wvPBscvpnBMg7tW8zITzlfmoIe7H5JFrDzzNF 12 | 4rZRh1zJTEpgBqIZlqSCWuH65vJDcwfvatnpMv/MzSdJgOOmcsCyNx09AhnWCXy0 13 | RkphQEZmzAo1renqwrvo0z4WhigIoTL/ZsKgN5/gOFvvWp5deA1wSVrIQaUt4IES 14 | MCGKrwo0f0Te0Bg28aV1Bxfhc2Y2xY4RNYsU9ESveVprGMSTKSEkJqqV9XPBVVP+ 15 | 95I/crV0fWiIlrNIKEz5FBPelsYv5IXeBmH0 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/client.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDizCCAnOgAwIBAgIUC0fcaCk4b8NOcKQGmh4m5JFP7fgwDQYJKoZIhvcNAQEL 3 | BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1TYW4gRnJh 4 | bmNpc2NvMRQwEgYDVQQDEwtleGFtcGxlLm5ldDAeFw0xODAzMzExMDI2MDBaFw0y 5 | ODAzMjgxMDI2MDBaMAAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv 6 | y7lRhyuFI3eTQpJ1HCv1XK6bOdTYOTjD+fiyUlAyy74uGg+TjA0aixBFLVuzBTSN 7 | E7Eg/m4ktI8XZvK/Vvbrft0b0JCSBd/uyfKvVjwcWaIAShExoqzs+HXrVFIXB4BR 8 | q2toXwTg+D3KrFcPQe7z6Yv+XAndLoAy4tqvtSdcLV2O9u/5kWuE+W6BXjYMKkVC 9 | N8uhCNydFJGHJqgIgkStHzwdxicy69fJcCy/7+CVHLftlbo8cqkowz7zdTXQA7gt 10 | a8mpNHxVGWe4PWGYas8ANaA8ENnIVclUaXxLBa4Vze+JYSySaGyWW5zsnefjhisY 11 | EyVkse2Upx+fq9W6RM6nAgMBAAGjgbQwgbEwDgYDVR0PAQH/BAQDAgWgMB0GA1Ud 12 | JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQW 13 | BBQ3+QcQOfJEVFrJ8qoeLjAB+HU2SzAfBgNVHSMEGDAWgBQQ3X9Ls9PPbM4yYKED 14 | JR2aqgcvzzAyBgNVHREBAf8EKDAmghNjbGllbnQuZ2xvYmFsLm5vbWFkgglsb2Nh 15 | bGhvc3SHBH8AAAEwDQYJKoZIhvcNAQELBQADggEBAGvLQzXAon+V+OQ2e1bsvUxa 16 | VuMHKunqNT2V0xdILm3G+/Ae7PpYdsc9CK1ybW+X68SyRuz1wg4NctXM3K9+0AhX 17 | hcudiKL0mDnlf0FVqTe3f/p3I++F+dw/sCkgV18IX9q1na3Y6i2N9IqiktwEqzC2 18 | Nq1ZW2RzfbEYHsy+ZWB6l6lplIXdj+3PFaqumRdr4gjhBVevKEwpStizn4HAt4VT 19 | /WmLgSeNhZL0DXXtyH1fbckq593uNbps8ofYoUMDx6nWo3hp8vwPPkaADHDi6uCc 20 | I1BQvbFPdJK14KSsBR9gxq1l+dKsZmVvSvrwW5ZK499T0K/a58+bV+iKIT4LtGQ= 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/nomad-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "example.net", 3 | "hosts": [ 4 | "example.net", 5 | "www.example.net" 6 | ], 7 | "key": { 8 | "algo": "rsa", 9 | "size": 2048 10 | }, 11 | "names": [ 12 | { 13 | "C": "US", 14 | "ST": "CA", 15 | "L": "San Francisco" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/nomad-ca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAzrF2r8TdjLPM1E7pCUzQOwx36Fs3/2mPz3SVAjTqyVwU4IQ5 3 | fnlFXimU0CHhCiN7XfAPlaadSvdpFh5LWKh4Hljx5oL4IUrYXUzjDC3Hfv6O7TmG 4 | SklGi8RXX5JjchIROCStVTaB64SEaYAn8ftSzWnYk3j2JTTI/pPGSpNkb6x81zyM 5 | IgN8Ed9xxPZAdWU8prtmPsfVW8iFTs3u7N3VSKZGUrsBBrKFZIjAg7wSEma6C+IM 6 | DVHiQOR4oVoHLU6teEuBNvCLRn3LQdAwrTribFI7ROFHEDFRq2qNX/QIJwyt7OEE 7 | V6x74zn63Lg+PzTEh6KBTFMmGZJpqMe/34eJIwIDAQABAoIBAFCpoQ/nXC7U3FLe 8 | mMMwXvMsYn8jWi8rGxxy+tPpotcCQIN+FpHs8c1VnOW80v4J6tM2JF7arvfapgAj 9 | wnPPC1GMlJrI8dzMQLPolZLjKr+8yDp8AJRtFELnVNHPZ0/VDTND3QEsTHeFN8eU 10 | ZAJjemT/sa2bvzO17dqsAO6JpuCNVH9w6FWkEt637ccMhwy0ZteJ0xUWfk3Fj94r 11 | MOc12frIX6B+mxS25jxUWtq8Iqkz6U75rN11bXADWGrIeOr8I8Jou29nENGVTYbb 12 | njvDEbK8CMqxEXoRYJtIve8WldsoSMN8Ve71TEsSP1P9qEWEokvnuvHUOOlcrZoK 13 | WIxjtMECgYEA5JxwI86bAa+KWYbQC4jqqwNjhaxeHoCXMxoNUR6ITlAzgIYYpZvU 14 | zdwsWM1kWbnWY5KUXgyrlr89REAGM7p9IKOwj98P3V2JTXQQJFCVW1004AxDdYzl 15 | aOnHMfG+IbnOmvJyE2v7XIeqxswbBr13lKS++ULmdFxMhhNk2uwREnUCgYEA53TM 16 | fWZr/wphyBkNKYpurqp2mY5ktzbChVYxc5UXxwYym8BSAYo8VgyJ+du/cYGTmIHC 17 | 84QworvcIULPWEIpkLBJSaord5zSjGpyFZOlJxIuIwVuDUwtIjQhyJMUdZVg8pcW 18 | 2CT+SEW2qAf/BqEUT4KyxvXQhT3lzy1ei1wUCjcCgYEAgb4u/oNhAWHouMqEBCfe 19 | VtQDhXe/qrv8E6pzaFhVr2xg7k4sasC302VjXbqjezC29afYwE+cil9anANiAbWT 20 | EhUUPXKxBEbzh5uZFaMOQN3zBjyvhGVERXh37mZuK6HSGaoDB/a+n1L3nv9zTy30 21 | Uc31/Gz1cZB4dZdII97aCYkCgYEAxWoPyJ2FW6ElSaBkY5wZT41BXzPen45rV4Lu 22 | 5uCxySV2IPZme73GPLaxMJXHsi6NDzUObNnBCewlk5ECfQrhnPFfcR9dt8Xgp7da 23 | 2yB1at/Mzj4hYeIpVNUWQ5d/idMBP6iy6WSUJlyfsK4xTRwy0KZvide8JQloa88M 24 | ptzAkv0CgYBQ9Jbaj/tXGoIO4RH/oWKpU7iizDXHBFwKm3GHeJGt03MhOc9mcWrC 25 | 0osOAL2xe+AipbHdodBHn4EhYlDa1x6L5DQKp4vdrsU602r32B6wk65q94NfYcLF 26 | J0vEg9ox8wlut2br4iohBp8/CCuitwJye/iJ5XoCxIlS6l+d303A2w== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/nomad-ca.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQH 3 | Ew1TYW4gRnJhbmNpc2NvMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI 4 | hvcNAQEBBQADggEPADCCAQoCggEBAM6xdq/E3YyzzNRO6QlM0DsMd+hbN/9pj890 5 | lQI06slcFOCEOX55RV4plNAh4Qoje13wD5WmnUr3aRYeS1ioeB5Y8eaC+CFK2F1M 6 | 4wwtx37+ju05hkpJRovEV1+SY3ISETgkrVU2geuEhGmAJ/H7Us1p2JN49iU0yP6T 7 | xkqTZG+sfNc8jCIDfBHfccT2QHVlPKa7Zj7H1VvIhU7N7uzd1UimRlK7AQayhWSI 8 | wIO8EhJmugviDA1R4kDkeKFaBy1OrXhLgTbwi0Z9y0HQMK064mxSO0ThRxAxUatq 9 | jV/0CCcMrezhBFese+M5+ty4Pj80xIeigUxTJhmSaajHv9+HiSMCAwEAAaA6MDgG 10 | CSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt 11 | cGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEApEv5meT1bHnrAnC8Sciv9KYAMoAj 12 | fTU/0vjtx7VvLqntWAjAf9RSYfhV3cerV1A3SQeUQMTzvbqKJsWqCwqQu3RJVPWQ 13 | ttr0WQ57Kd0FxJRSImJCGXw/HGWo+IPGPDB6+cSLZw8C5OPt+htAyc/OUCLqVv+m 14 | tCbeNDErN4WLXmF/waFFoWCCcL0kSS6CjnviaD+VNFSvORPDCnHVgCjxUcDdgO7t 15 | fUihziwMaSOjR9DKNIMCBB00Y6ATvN85ANq0VkzBjALdZWfV8o6D9BOOp1EddzjN 16 | CMoWzvunu6t+QlhZsE+BUYFruLH73oTewFi1d2uRaAkGhMmBanM6MRqujw== 17 | -----END CERTIFICATE REQUEST----- 18 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/nomad-ca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDYDCCAkigAwIBAgIUBCR7VnY/cFoDszDfyQoEcRi99q0wDQYJKoZIhvcNAQEL 3 | BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1TYW4gRnJh 4 | bmNpc2NvMRQwEgYDVQQDEwtleGFtcGxlLm5ldDAeFw0xODAzMzExMDI2MDBaFw0y 5 | MzAzMzAxMDI2MDBaMEgxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UE 6 | BxMNU2FuIEZyYW5jaXNjbzEUMBIGA1UEAxMLZXhhbXBsZS5uZXQwggEiMA0GCSqG 7 | SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDOsXavxN2Ms8zUTukJTNA7DHfoWzf/aY/P 8 | dJUCNOrJXBTghDl+eUVeKZTQIeEKI3td8A+Vpp1K92kWHktYqHgeWPHmgvghSthd 9 | TOMMLcd+/o7tOYZKSUaLxFdfkmNyEhE4JK1VNoHrhIRpgCfx+1LNadiTePYlNMj+ 10 | k8ZKk2RvrHzXPIwiA3wR33HE9kB1ZTymu2Y+x9VbyIVOze7s3dVIpkZSuwEGsoVk 11 | iMCDvBISZroL4gwNUeJA5HihWgctTq14S4E28ItGfctB0DCtOuJsUjtE4UcQMVGr 12 | ao1f9AgnDK3s4QRXrHvjOfrcuD4/NMSHooFMUyYZkmmox7/fh4kjAgMBAAGjQjBA 13 | MA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQQ3X9L 14 | s9PPbM4yYKEDJR2aqgcvzzANBgkqhkiG9w0BAQsFAAOCAQEACdJvt5wO7MSjB4V/ 15 | b1+nVzxtTDa5ZsobWIGS5lX/G2IWcdTQhy5EU649BOV9WyaJio9ewARLkxuCG94m 16 | X7a/xXS9cfxb1ILPdT+GVk0tnNM3a9+5AEs+RpOfB2FU1nX9H31w30Y75bK7nxYX 17 | QQcK0rFlHNvqE9LkcflZrwWE0aAQYZLTy2pvzxjUvVv2WLxm0WwyZW4i9tjEiLPh 18 | WGZiKgNlO1fpih60ESGHC2OTT4p6y5IubcCattUxC1CV0F2pcmfXEhlbsdDWNY4z 19 | zVeu3913m9jOtVP8FLXasweMICPs2zenOP+w9so68f36QXt05ASRzpaNh8wrTP9z 20 | uBOEJA== 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/sdk-key-p8.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC71qxzyB0fHgHO 3 | RLtVTXwu41JnDQZa3eUValXAES/VlvINkGiLUNcAKhBSTUP9ii485kf5QeOO5o18 4 | 1JJAq8TpIHNULwH/A+oNXdnEG41PJmTNQ2aU2tGRKYb9FiKOc+6zbWYoBxRmjAT7 5 | 5MYvjPYnXm8V3NRqyGWeCDhtFkcm5FtUOc9jGkcCnEnnjmdUGjxyT5+Tp7pK+KsY 6 | i0LAzf3AnAI1Kf/H18jq2GVakmWQoLcwgee54ZUXq1U7YAY3SS5f2EYuE8T2v5Q0 7 | rH9rSskxjGl5IO8h+bZjBXFmxE/uTb1T6cv/w5ju+fcf/07CJYOxyK0EsaYkaA0W 8 | 0PtsGX31AgMBAAECggEAUuuit334tRrnCyq2VCLflkdNwiYyzvwzu+90KVSs/Col 9 | cq10KUQnlW/8QojPYeaVINc7oKJglV3byeaBJcFuLMfhgaE6zVvp/7qVfof3KqC1 10 | URPW/hFXADEH4UPbP22YS2cY+MSfUeGv9Y75mlYs+BYtDcatkvIiQdA5MJbsFBNr 11 | BL0uqRgJD2qYia46C5fdb7AMItfz7DLjlqhiZzjOpa11wLz5FXQBx5gyjysURPHD 12 | O/AeeKTv1tVF2ShEZQ6GiW6339zsSYtA2kuxzLgLq15eZiNPbVC6UjK2sMNu/iMN 13 | AfLJazZ8h9t0n3bceaGWgFyKx0SNDnqyAfRgq5pOgQKBgQDnh0sVFTU5fyIwYMTY 14 | I4wXhyG4nYebgsLxxC8VSVLqUXm1kD6oW9yrv4klNHVjfh3LRWCDRauoo0FeDDhN 15 | 2sx3Q7kNgbs5UqZlE6bxPGnuLTAYafM291qwQlsfFPYS+8R6/Vutb0YYqGcVWM0y 16 | /lfFnRPjJO0RJsw98958MeUSYQKBgQDPsTeBGGqPSKL0TD8vzYxx7GnxGBX0iY3n 17 | C6117oUII5MSTapQfVLNSYTfOftRRHYyFP1/qmVms2OCRayGRm2fgspcNou0/I/y 18 | cK5gtNAOsH4scGs66tR5EnQ/nj93qXRyI3J9ndNzP1gzzkLyrR/CZkOEEaCHnr6b 19 | RNWJ6Gh8FQKBgHRAADkDvwexh+8Wh3+myY5+sTXLEu3ISC2wPZvIhzNT2XKKjIto 20 | JHKv5yKhJlfgWQFZQk5nSvuPjSC1rgeZVpSDkoTvoJv1ncqehXIWzXFjiwSXHiF5 21 | LTXW+32tvqhldY/zana4qk9zLt8PCWkTP+rfJb8lKUs1WdO5gPqG6ufBAoGBALzm 22 | SzxQT8MIZqXZn3LD+iQ3yVet93IVlgn5lgf4K+juKjrwhqJ0idYLMx2w58LPiM0e 23 | SD5QZa/WIwB+jF8IOXZmB9V9Cu5O9EGmeQOeEMn7fpa+nNjWcu+3eCHQtZsJdc7G 24 | LMDRxltA1uEvjbaY/ZTbXDcHrUEMggJIxguLZVTNAoGAPYIYgrjdb6/fe5S3Fj3R 25 | ZpUqiaxrN8gD4g/qMhP3T/gLkLC8Xi2eYBk7XyljVGJTQ0d9g4ljIw+mdJ+3SFAz 26 | 5Fwxp0FcNIfNsUQFcdcJr9zUc3WXkom/fdezKnYUQ+w18Ks+Syk00ffTi41tFg/1 27 | QyYI44BWfqGKKwJUzlYRzFY= 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/sdk-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAu9asc8gdHx4BzkS7VU18LuNSZw0GWt3lFWpVwBEv1ZbyDZBo 3 | i1DXACoQUk1D/YouPOZH+UHjjuaNfNSSQKvE6SBzVC8B/wPqDV3ZxBuNTyZkzUNm 4 | lNrRkSmG/RYijnPus21mKAcUZowE++TGL4z2J15vFdzUashlngg4bRZHJuRbVDnP 5 | YxpHApxJ545nVBo8ck+fk6e6SvirGItCwM39wJwCNSn/x9fI6thlWpJlkKC3MIHn 6 | ueGVF6tVO2AGN0kuX9hGLhPE9r+UNKx/a0rJMYxpeSDvIfm2YwVxZsRP7k29U+nL 7 | /8OY7vn3H/9OwiWDscitBLGmJGgNFtD7bBl99QIDAQABAoIBAFLrord9+LUa5wsq 8 | tlQi35ZHTcImMs78M7vvdClUrPwqJXKtdClEJ5Vv/EKIz2HmlSDXO6CiYJVd28nm 9 | gSXBbizH4YGhOs1b6f+6lX6H9yqgtVET1v4RVwAxB+FD2z9tmEtnGPjEn1Hhr/WO 10 | +ZpWLPgWLQ3GrZLyIkHQOTCW7BQTawS9LqkYCQ9qmImuOguX3W+wDCLX8+wy45ao 11 | Ymc4zqWtdcC8+RV0AceYMo8rFETxwzvwHnik79bVRdkoRGUOholut9/c7EmLQNpL 12 | scy4C6teXmYjT21QulIytrDDbv4jDQHyyWs2fIfbdJ923HmhloBcisdEjQ56sgH0 13 | YKuaToECgYEA54dLFRU1OX8iMGDE2COMF4chuJ2Hm4LC8cQvFUlS6lF5tZA+qFvc 14 | q7+JJTR1Y34dy0Vgg0WrqKNBXgw4TdrMd0O5DYG7OVKmZROm8Txp7i0wGGnzNvda 15 | sEJbHxT2EvvEev1brW9GGKhnFVjNMv5XxZ0T4yTtESbMPfPefDHlEmECgYEAz7E3 16 | gRhqj0ii9Ew/L82Mcexp8RgV9ImN5wutde6FCCOTEk2qUH1SzUmE3zn7UUR2MhT9 17 | f6plZrNjgkWshkZtn4LKXDaLtPyP8nCuYLTQDrB+LHBrOurUeRJ0P54/d6l0ciNy 18 | fZ3Tcz9YM85C8q0fwmZDhBGgh56+m0TViehofBUCgYB0QAA5A78HsYfvFod/psmO 19 | frE1yxLtyEgtsD2byIczU9lyioyLaCRyr+cioSZX4FkBWUJOZ0r7j40gta4HmVaU 20 | g5KE76Cb9Z3KnoVyFs1xY4sElx4heS011vt9rb6oZXWP82p2uKpPcy7fDwlpEz/q 21 | 3yW/JSlLNVnTuYD6hurnwQKBgQC85ks8UE/DCGal2Z9yw/okN8lXrfdyFZYJ+ZYH 22 | +Cvo7io68IaidInWCzMdsOfCz4jNHkg+UGWv1iMAfoxfCDl2ZgfVfQruTvRBpnkD 23 | nhDJ+36WvpzY1nLvt3gh0LWbCXXOxizA0cZbQNbhL422mP2U21w3B61BDIICSMYL 24 | i2VUzQKBgD2CGIK43W+v33uUtxY90WaVKomsazfIA+IP6jIT90/4C5CwvF4tnmAZ 25 | O18pY1RiU0NHfYOJYyMPpnSft0hQM+RcMadBXDSHzbFEBXHXCa/c1HN1l5KJv33X 26 | syp2FEPsNfCrPkspNNH304uNbRYP9UMmCOOAVn6hiisCVM5WEcxW 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/sdk.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICcjCCAVoCAQAwADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALvW 3 | rHPIHR8eAc5Eu1VNfC7jUmcNBlrd5RVqVcARL9WW8g2QaItQ1wAqEFJNQ/2KLjzm 4 | R/lB447mjXzUkkCrxOkgc1QvAf8D6g1d2cQbjU8mZM1DZpTa0ZEphv0WIo5z7rNt 5 | ZigHFGaMBPvkxi+M9idebxXc1GrIZZ4IOG0WRybkW1Q5z2MaRwKcSeeOZ1QaPHJP 6 | n5Onukr4qxiLQsDN/cCcAjUp/8fXyOrYZVqSZZCgtzCB57nhlRerVTtgBjdJLl/Y 7 | Ri4TxPa/lDSsf2tKyTGMaXkg7yH5tmMFcWbET+5NvVPpy//DmO759x//TsIlg7HI 8 | rQSxpiRoDRbQ+2wZffUCAwEAAaAtMCsGCSqGSIb3DQEJDjEeMBwwGgYDVR0RBBMw 9 | EYIJbG9jYWxob3N0hwR/AAABMA0GCSqGSIb3DQEBCwUAA4IBAQA3quphY8HT6JXA 10 | bjRc7oMjQp/LXi9g0Q6MI4HWcbpdtlVKHXtIbCP78Dk6bx0lHVDC+9LUE9IUw/Ab 11 | dzxRwN8PA1WLa3ZpDzMTGJ2w4L3Sm1AIgQTnqSkZNbLWaS9hnUWABYs1eBZJ4kot 12 | wCoXJaR0RO6vhr8H8a6tDBkVQkzcFY/RU4j+9aoeNxpcFQs2Xn9j7sOAYDZUnZCG 13 | qXeKVsGDM43SH2bjp/ek6k/OGNccJ3QN9SngwP9hNhSw0J/qR4ZyTX1fnQyKjqiP 14 | ii7I34CAhCWULLGAqPXc1Ue6BitANoDu6ccX8C7Vl3Qobnb9FSV5FiAT6AF7YmHZ 15 | dHJdSPEH 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/sdk.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDdjCCAl6gAwIBAgIULH7k6WZPIHL+5q5wE6SJ8fECIJIwDQYJKoZIhvcNAQEL 3 | BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1TYW4gRnJh 4 | bmNpc2NvMRQwEgYDVQQDEwtleGFtcGxlLm5ldDAeFw0xODAzMzExMDI2MDBaFw0x 5 | OTAzMzExMDI2MDBaMAAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7 6 | 1qxzyB0fHgHORLtVTXwu41JnDQZa3eUValXAES/VlvINkGiLUNcAKhBSTUP9ii48 7 | 5kf5QeOO5o181JJAq8TpIHNULwH/A+oNXdnEG41PJmTNQ2aU2tGRKYb9FiKOc+6z 8 | bWYoBxRmjAT75MYvjPYnXm8V3NRqyGWeCDhtFkcm5FtUOc9jGkcCnEnnjmdUGjxy 9 | T5+Tp7pK+KsYi0LAzf3AnAI1Kf/H18jq2GVakmWQoLcwgee54ZUXq1U7YAY3SS5f 10 | 2EYuE8T2v5Q0rH9rSskxjGl5IO8h+bZjBXFmxE/uTb1T6cv/w5ju+fcf/07CJYOx 11 | yK0EsaYkaA0W0PtsGX31AgMBAAGjgZ8wgZwwDgYDVR0PAQH/BAQDAgWgMB0GA1Ud 12 | JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQW 13 | BBTpQvikBqXycfe70EBlfnUtzJOJ/DAfBgNVHSMEGDAWgBQQ3X9Ls9PPbM4yYKED 14 | JR2aqgcvzzAdBgNVHREBAf8EEzARgglsb2NhbGhvc3SHBH8AAAEwDQYJKoZIhvcN 15 | AQELBQADggEBAIbLnqLAP+OzAI52TsDR1fgWV9xsLAR7zkf+6BkDTvWYKvNFQRuS 16 | dVLvYmUmXVyOB7cEPzC+jLn7CJ6jPDXlbVUAxXvQ60dav96kWHE2MRtsIHVraGcw 17 | KeGrrHD+1+Tg6JrjftteqOBIVBUx+kjkcchVHiCw49y1wae93wu/Pva6nnkuosPs 18 | bB1R8+rEP7WvQTuwy6AR1Y5xOjei2i6figsFnbIXPtDvtyCQ13p1XRiBVBmNe+nz 19 | XaRyEeWprBqNXt2nWhfBCDKaUMQbpDdzfp2YrP2GYiHpo+Gb/4J6kq74TfYT023E 20 | E3WsMAmyQV15+UZ4XwzRsFZV9faZPRmlPLw= 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/server-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAkvRwBlWKe5/38L4BpG5/vhHDCAmc2cGqeP57Ylv3S6wVkiUd 3 | gM3LL4HjplpVp1h+CyP5tEAW4L2qphn7YpKSiodh4X0OkqPDl0SqL8Y+QxKMAaSj 4 | rc/dHIj8ulYjfyW+w38s9CjuTzo2GaDHXyK6TtN4R2rPk0txBaWC5bLrJv5LsQdv 5 | C5eJIJHHuKiYkPupzKl5l+IrN43BlOifkgGLO0BhJxOJJq2H5+tGXwAwwulTtazc 6 | C4HhLQMJPHr/TgMlhtbuEt4qV+lLTbzvd85ADWYxips/VCCjBNzQNau1qlYlLxYV 7 | CyRpOL7Btj5OjHfg5wwVAiyaQiR7k2Q3s9VOXQIDAQABAoIBAQCEYvEIw8cd197l 8 | YkbYezNZZ2brtr027uFEXv2IfpEp+rz0C7uobby976XGF1tShsYGA0LQv2vcywEQ 9 | 4hc1lhWt9oiXOrIGKMHrZFBs+Yrdobe/QzKxQrFPI5mJxE/2G2rfc5Jr4vPNLAPQ 10 | 0qbJbd+pY5jXvcGCUFRhYdmqVKTDWrYcyT2/AyIwPFkRh6gGS/DREC5FN48fsT3W 11 | AAkmtpjPrHx+LXZ2Hgb7gJvlDsIqhbxcUpaVt2fWZ+eSqECUY20pOL71hIHWY6z1 12 | spaE7zv296tOsP29I8uAHxRCghAsMCNAEVlnfk4mo2XZrL4fywbHAAwn+/xEat8N 13 | xZyCAHWBAoGBAMEcSvfPMV6A+emzmsokH/F3D0uz2bcXmBFom2M9Mf8SiV+hqvZY 14 | gUHMbvtsuzjEMXzfoC696l9UyXt2taDfIaaPRGPhBywOoaNibDl1ZivodohY1SYm 15 | o3xQV5StOUNmrA/thQPUBzWb3MyE0GJw4+LquDAAdOIczRD6wuY8SI2TAoGBAMLQ 16 | IB1JtzF6ItuZy18VonQUqU5nr0kmM7i+jpeaDL1jqX5932VHWsTRODO//pblkcp6 17 | aE+byb8dHfNdFRGUDKQ8pV/zqcwUZBX6uAd+kN5H9KVrpmifQo9O6DbO+cnlCIHU 18 | asyzwCSbJDpOEhplofpMxmv6mx4gu03EdLvbmqpPAoGAWTtEnOt9iYiZclbOoLc+ 19 | l2oHhFiPsp3RY8Htg1bEonOjTLA8emZ9G7VmVwFwJZPqtiPzNYYGJZTdIRLCbJqO 20 | RxOOa4SQttfv8rpI/ef0lTduhiReIanbA1dwkL/WZQGtYhLD0vgHeMsTpOF+FO7L 21 | LpB9GZksaUsbqsvkgVS7xccCgYEAndlhjBmktBRQljshTCQNg50SKhNdNhocIn9U 22 | roYF+Jb+SR3YmwmcBIm5zkStFrtgy/0u9AI5D/+Zuw0a+ylIrPLu1LZsSI3lIuIJ 23 | pxjobRNEqZx2M6OHnPLEuVQvlWVc5UWmW8Lx1zdVvWBwzq629karJ+bhNSI0Yiji 24 | pSylP4UCgYAj36GXsteGz2+RPDqtUA5XFZQYlXJNi6qr4yLzFqn53PN9ZqE/1BNZ 25 | MSDJQRHeojABDXEcnfETfKcUO/1IPLvUK8YpV0u1dO0l1P0ZayGYv3nF41dM/F4H 26 | vqfRRWIHqn7Zn9QJvJHjDG/rLjH5T5jWJAt/pNfKc3OBTL9cDtnDmw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/server.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIChzCCAW8CAQAwADCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJL0 3 | cAZVinuf9/C+AaRuf74RwwgJnNnBqnj+e2Jb90usFZIlHYDNyy+B46ZaVadYfgsj 4 | +bRAFuC9qqYZ+2KSkoqHYeF9DpKjw5dEqi/GPkMSjAGko63P3RyI/LpWI38lvsN/ 5 | LPQo7k86Nhmgx18iuk7TeEdqz5NLcQWlguWy6yb+S7EHbwuXiSCRx7iomJD7qcyp 6 | eZfiKzeNwZTon5IBiztAYScTiSath+frRl8AMMLpU7Ws3AuB4S0DCTx6/04DJYbW 7 | 7hLeKlfpS02873fOQA1mMYqbP1QgowTc0DWrtapWJS8WFQskaTi+wbY+Tox34OcM 8 | FQIsmkIke5NkN7PVTl0CAwEAAaBCMEAGCSqGSIb3DQEJDjEzMDEwLwYDVR0RBCgw 9 | JoITc2VydmVyLmdsb2JhbC5ub21hZIIJbG9jYWxob3N0hwR/AAABMA0GCSqGSIb3 10 | DQEBCwUAA4IBAQAex1KBGnHUC6cx5HyPnt8Mk4JyQ+A5NrTfM/2yQ7fzE5LRYBpY 11 | 79CYIuHRt4qO096cdzdoClgoAZ9/J+xtr6yTb6eeNGuLMKJFziXIbKPihtNO4tsE 12 | xOMFn8SKjz0YRdmSG7ZKTqLfAHdrkPJdRkH1ehRgl4M+LxAwFwKggGP4YXtBcfWI 13 | VG3UxKmtv/W3jGaD3xkieakti3cGMlFKgQW3X+FVvgMHe39N3+YoaxLRbWLQbRUb 14 | gLH/8YxlZogyV343xv7cGhUfW+4Gkgz2dWiBzfan14uLhwZIBbGL4/ov+O7qhwxl 15 | ilGPJwJvhZSruXPLdHHCbPW5Y352L1l1s72y 16 | -----END CERTIFICATE REQUEST----- 17 | -------------------------------------------------------------------------------- /testkit/src/test/resources/com/hashicorp/nomad/testutils/server.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDizCCAnOgAwIBAgIUYZuMHb6r6DLPR+QFE7VUwT1h2xAwDQYJKoZIhvcNAQEL 3 | BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1TYW4gRnJh 4 | bmNpc2NvMRQwEgYDVQQDEwtleGFtcGxlLm5ldDAeFw0xODAzMzExMDI2MDBaFw0y 5 | ODAzMjgxMDI2MDBaMAAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCS 6 | 9HAGVYp7n/fwvgGkbn++EcMICZzZwap4/ntiW/dLrBWSJR2AzcsvgeOmWlWnWH4L 7 | I/m0QBbgvaqmGftikpKKh2HhfQ6So8OXRKovxj5DEowBpKOtz90ciPy6ViN/Jb7D 8 | fyz0KO5POjYZoMdfIrpO03hHas+TS3EFpYLlsusm/kuxB28Ll4kgkce4qJiQ+6nM 9 | qXmX4is3jcGU6J+SAYs7QGEnE4kmrYfn60ZfADDC6VO1rNwLgeEtAwk8ev9OAyWG 10 | 1u4S3ipX6UtNvO93zkANZjGKmz9UIKME3NA1q7WqViUvFhULJGk4vsG2Pk6Md+Dn 11 | DBUCLJpCJHuTZDez1U5dAgMBAAGjgbQwgbEwDgYDVR0PAQH/BAQDAgWgMB0GA1Ud 12 | JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQW 13 | BBQEXd9EMiqIx9JpTf4+gd0QQXGd3jAfBgNVHSMEGDAWgBQQ3X9Ls9PPbM4yYKED 14 | JR2aqgcvzzAyBgNVHREBAf8EKDAmghNzZXJ2ZXIuZ2xvYmFsLm5vbWFkgglsb2Nh 15 | bGhvc3SHBH8AAAEwDQYJKoZIhvcNAQELBQADggEBACyzu1jGrcXXUo0iWkB9RoUs 16 | mnOsPG06hW2iWYgKsMO8qyXu5bluECbWc1W3wry1t5nJxmmTxCk+WGhd2sQeXEPG 17 | O8x/+yoGUYuGgd7ke/ZMw8mBssQtiw/XrcLst9psk9SUpJinswN9K0kZULvCDWGV 18 | w0L/j8Wc0qYtWADxeBlfuq4Xvd7aNdVq04douYyA+O12iOxjFcbAXigLEeSveZEd 19 | fbGfwX4JqirZAtfsHMVkR1MSbpvps87zxVFvN5MkT5FZmSfkxXsJU90xHtK4N3bD 20 | mSIgfibVFZXIaOJmTSzRfpvmEpRfkzTUebfybnDDBssVuS5PNBKQlGBbf8+CCl8= 21 | -----END CERTIFICATE----- 22 | --------------------------------------------------------------------------------